Skip to content

Commit 1b56d7e

Browse files
authored
Add authorization property to ML datafeed, job, and transform specs
1 parent 44d8b0f commit 1b56d7e

File tree

12 files changed

+660
-242
lines changed

12 files changed

+660
-242
lines changed

output/schema/schema.json

Lines changed: 473 additions & 188 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/validation-errors.json

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 57 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
export class ApiKeyAuthorization {
21+
/**
22+
* The identifier for the API key.
23+
*/
24+
id: string
25+
/**
26+
* The name of the API key.
27+
*/
28+
name: string
29+
}
30+
31+
export class DatafeedAuthorization {
32+
/**
33+
* If an API key was used for the most recent update to the datafeed, its name and identifier are listed in the response.
34+
*/
35+
api_key?: ApiKeyAuthorization
36+
/**
37+
* If a user ID was used for the most recent update to the datafeed, its roles at the time of the update are listed in the response. */
38+
roles?: string[]
39+
/**
40+
* If a service account was used for the most recent update to the datafeed, the account name is listed in the response.
41+
*/
42+
service_account?: string
43+
}
44+
45+
export class DataframeAnalyticsAuthorization {
46+
/**
47+
* If an API key was used for the most recent update to the job, its name and identifier are listed in the response.
48+
*/
49+
api_key?: ApiKeyAuthorization
50+
/**
51+
* If a user ID was used for the most recent update to the job, its roles at the time of the update are listed in the response. */
52+
roles?: string[]
53+
/**
54+
* If a service account was used for the most recent update to the job, the account name is listed in the response.
55+
*/
56+
service_account?: string
57+
}
58+
59+
export class TransformAuthorization {
60+
/**
61+
* If an API key was used for the most recent update to the transform, its name and identifier are listed in the response.
62+
*/
63+
api_key?: ApiKeyAuthorization
64+
/**
65+
* If a user ID was used for the most recent update to the transform, its roles at the time of the update are listed in the response. */
66+
roles?: string[]
67+
/**
68+
* If a service account was used for the most recent update to the transform, the account name is listed in the response.
69+
*/
70+
service_account?: string
71+
}

specification/ml/_types/Datafeed.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,15 @@ import {
3232
UnitFloatMillis
3333
} from '@_types/Time'
3434
import { DiscoveryNode } from './DiscoveryNode'
35+
import { DatafeedAuthorization } from '@ml/_types/Authorization'
3536

3637
export class Datafeed {
3738
/** @aliases aggs */
3839
aggregations?: Dictionary<string, AggregationContainer>
40+
/**
41+
* The security privileges that the datafeed uses to run its queries. If Elastic Stack security features were disabled at the time of the most recent update to the datafeed, this property is omitted.
42+
*/
43+
authorization?: DatafeedAuthorization
3944
chunking_config?: ChunkingConfig
4045
datafeed_id: Id
4146
frequency?: Duration

specification/ml/_types/DataframeAnalytics.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { double, integer, long, Percentage } from '@_types/Numeric'
3434
import { QueryContainer } from '@_types/query_dsl/abstractions'
3535
import { UnitMillis, DurationValue, EpochTime } from '@_types/Time'
3636
import { DataframeState } from './Dataframe'
37+
import { DataframeAnalyticsAuthorization } from '@ml/_types/Authorization'
3738

3839
export class DataframeAnalyticsSource {
3940
/** Index or indices on which to perform the analysis. It can be a single index or index pattern as well as an array of indices or patterns. NOTE: If your source indices contain documents with the same IDs, only the document that is indexed last appears in the destination index.*/
@@ -303,16 +304,20 @@ export class DataframeAnalysisFeatureProcessorTargetMeanEncoding {
303304
}
304305

305306
export class DataframeAnalyticsSummary {
306-
id: Id
307-
source: DataframeAnalyticsSource
308-
dest: DataframeAnalyticsDestination
307+
allow_lazy_start?: boolean
309308
analysis: DataframeAnalysisContainer
310-
description?: string
311-
model_memory_limit?: string
312-
max_num_threads?: integer
313309
analyzed_fields?: DataframeAnalysisAnalyzedFields
314-
allow_lazy_start?: boolean
310+
/**
311+
* The security privileges that the job uses to run its queries. If Elastic Stack security features were disabled at the time of the most recent update to the job, this property is omitted.
312+
*/
313+
authorization?: DataframeAnalyticsAuthorization
315314
create_time?: EpochTime<UnitMillis>
315+
description?: string
316+
dest: DataframeAnalyticsDestination
317+
id: Id
318+
max_num_threads?: integer
319+
model_memory_limit?: string
320+
source: DataframeAnalyticsSource
316321
version?: VersionString
317322
}
318323

specification/ml/put_data_frame_analytics/MlPutDataFrameAnalyticsResponse.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* under the License.
1818
*/
1919

20+
import { DataframeAnalyticsAuthorization } from '@ml/_types/Authorization'
2021
import {
2122
DataframeAnalysisAnalyzedFields,
2223
DataframeAnalysisContainer,
@@ -29,16 +30,17 @@ import { EpochTime, UnitMillis } from '@_types/Time'
2930

3031
export class Response {
3132
body: {
32-
id: Id
33+
authorization?: DataframeAnalyticsAuthorization
34+
allow_lazy_start: boolean
35+
analysis: DataframeAnalysisContainer
36+
analyzed_fields?: DataframeAnalysisAnalyzedFields
3337
create_time: EpochTime<UnitMillis>
34-
version: VersionString
35-
source: DataframeAnalyticsSource
3638
description?: string
3739
dest: DataframeAnalyticsDestination
38-
model_memory_limit: string
39-
allow_lazy_start: boolean
40+
id: Id
4041
max_num_threads: integer
41-
analysis: DataframeAnalysisContainer
42-
analyzed_fields?: DataframeAnalysisAnalyzedFields
42+
model_memory_limit: string
43+
source: DataframeAnalyticsSource
44+
version: VersionString
4345
}
4446
}

specification/ml/put_datafeed/MlPutDatafeedResponse.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* under the License.
1818
*/
1919

20+
import { DatafeedAuthorization } from '@ml/_types/Authorization'
2021
import { ChunkingConfig, DelayedDataCheckConfig } from '@ml/_types/Datafeed'
2122
import { Dictionary } from '@spec_utils/Dictionary'
2223
import { AggregationContainer } from '@_types/aggregations/AggregationContainer'
@@ -30,6 +31,7 @@ import { Duration } from '@_types/Time'
3031
export class Response {
3132
body: {
3233
aggregations: Dictionary<string, AggregationContainer>
34+
authorization?: DatafeedAuthorization
3335
chunking_config: ChunkingConfig
3436
delayed_data_check_config?: DelayedDataCheckConfig
3537
datafeed_id: Id

0 commit comments

Comments
 (0)