Skip to content

Commit f4a4074

Browse files
committed
Add spec for bulk put roles
1 parent 09b5022 commit f4a4074

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
import { Dictionary } from '@spec_utils/Dictionary'
21+
import { RequestBase } from '@_types/Base'
22+
import { Refresh } from '@_types/common'
23+
import {RoleDescriptor} from "@security/_types/RoleDescriptor";
24+
25+
/**
26+
* The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
27+
* The bulk create or update roles API cannot update roles that are defined in roles files.
28+
* @rest_spec_name security.bulk_put_role
29+
* @availability stack since=8.15.0 stability=stable
30+
* @availability serverless stability=stable visibility=private
31+
* @cluster_privileges manage_security
32+
*/
33+
export interface Request extends RequestBase {
34+
path_parts: {
35+
}
36+
query_parameters: {
37+
refresh?: Refresh
38+
}
39+
body: {
40+
/**
41+
* A dictionary of role name to RoleDescriptor objects to add or update
42+
*/
43+
roles: Dictionary<string, RoleDescriptor>
44+
}
45+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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+
import {integer} from "@_types/Numeric";
21+
import {ErrorCause} from "@_types/Errors";
22+
import {Dictionary} from "@spec_utils/Dictionary";
23+
24+
export class Response {
25+
body: {
26+
/**
27+
* Array of created roles
28+
*/
29+
created?: string[]
30+
/**
31+
* Array of updated roles
32+
*/
33+
updated?: string[]
34+
/**
35+
* Array of role names without any changes
36+
*/
37+
noop?: string[]
38+
/**
39+
* Present if any updates resulted in errors
40+
*/
41+
errors?: {
42+
/**
43+
* The number of errors
44+
*/
45+
count: integer
46+
/**
47+
* Details about the errors, keyed by role name
48+
*/
49+
details: Dictionary<string, ErrorCause>
50+
}
51+
}
52+
}

0 commit comments

Comments
 (0)