Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add restricted_roles to Synthetics tests and private locations #623

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.2",
"regenerated": "2022-04-06 13:53:31.412683",
"spec_repo_commit": "0c154010"
"regenerated": "2022-04-07 18:07:20.321699",
"spec_repo_commit": "5ed02dad"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-04-06 13:53:31.433241",
"spec_repo_commit": "0c154010"
"regenerated": "2022-04-07 18:07:20.339514",
"spec_repo_commit": "5ed02dad"
}
}
}
29 changes: 22 additions & 7 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11257,12 +11257,7 @@ components:
description: Attributes of the global variable.
properties:
restricted_roles:
description: List of role identifiers that can be pulled from the Roles
API.
items:
description: UUID for a role.
type: string
type: array
$ref: '#/components/schemas/SyntheticsRestrictedRoles'
type: object
SyntheticsGlobalVariableParseTestOptions:
description: Parser options to use for retrieving a Synthetics global variable
Expand Down Expand Up @@ -11407,6 +11402,8 @@ components:
description: Unique identifier of the private location.
readOnly: true
type: string
metadata:
$ref: '#/components/schemas/SyntheticsPrivateLocationMetadata'
name:
description: Name of the private location.
example: New private location
Expand Down Expand Up @@ -11450,6 +11447,12 @@ components:
description: Public key for result encryption.
type: string
type: object
SyntheticsPrivateLocationMetadata:
description: Object containing metadata about the private location.
properties:
restricted_roles:
$ref: '#/components/schemas/SyntheticsRestrictedRoles'
type: object
SyntheticsPrivateLocationSecrets:
description: Secrets for the private location. Only present in the response
when creating the private location.
Expand Down Expand Up @@ -11480,6 +11483,16 @@ components:
readOnly: true
type: string
type: object
SyntheticsRestrictedRoles:
description: A list of role identifiers that can be pulled from the Roles API,
for restricting read and write access.
example:
- xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
items:
description: UUID for a role.
example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
type: string
type: array
SyntheticsSSLCertificate:
description: Object describing the SSL certificate used for a Synthetic test.
properties:
Expand Down Expand Up @@ -11933,6 +11946,8 @@ components:
noScreenshot:
description: Prevents saving screenshots of the steps.
type: boolean
restricted_roles:
$ref: '#/components/schemas/SyntheticsRestrictedRoles'
retry:
$ref: '#/components/schemas/SyntheticsTestOptionsRetry'
tick_every:
Expand Down Expand Up @@ -24005,7 +24020,7 @@ paths:
operationId: DeletePrivateLocation
parameters:
- name: location_id
source: private_location
source: private_location.id
type: unsafe
/api/v1/synthetics/private-locations/{location_id}:
delete:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2022-04-07T08:48:04.711Z"

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/v1/synthetics/CreateGlobalVariable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const apiInstance = new v1.SyntheticsApi(configuration);
const params: v1.SyntheticsApiCreateGlobalVariableRequest = {
body: {
attributes: {
restrictedRoles: [],
restrictedRoles: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],
},
description: "Example description",
name: "MY_VARIABLE",
Expand Down
13 changes: 10 additions & 3 deletions examples/v1/synthetics/CreatePrivateLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ import { v1 } from "@datadog/datadog-api-client";
const configuration = v1.createConfiguration();
const apiInstance = new v1.SyntheticsApi(configuration);

// there is a valid "role" in the system
const ROLE_DATA_ID = process.env.ROLE_DATA_ID as string;

const params: v1.SyntheticsApiCreatePrivateLocationRequest = {
body: {
description: "Description of private location",
name: "New private location",
tags: ["team:front"],
description:
"Test Example-Create_a_private_location_returns_OK_response description",
metadata: {
restrictedRoles: [ROLE_DATA_ID],
},
name: "Example-Create_a_private_location_returns_OK_response",
tags: ["test:examplecreateaprivatelocationreturnsokresponse"],
},
};

Expand Down
1 change: 1 addition & 0 deletions examples/v1/synthetics/CreateSyntheticsAPITest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const params: v1.SyntheticsApiCreateSyntheticsAPITestRequest = {
options: {
deviceIds: ["laptop_large"],
monitorOptions: {},
restrictedRoles: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],
retry: {},
},
status: "live",
Expand Down
2 changes: 1 addition & 1 deletion examples/v1/synthetics/EditGlobalVariable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const apiInstance = new v1.SyntheticsApi(configuration);
const params: v1.SyntheticsApiEditGlobalVariableRequest = {
body: {
attributes: {
restrictedRoles: [],
restrictedRoles: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],
},
description: "Example description",
name: "MY_VARIABLE",
Expand Down
1 change: 1 addition & 0 deletions examples/v1/synthetics/UpdateBrowserTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const params: v1.SyntheticsApiUpdateBrowserTestRequest = {
options: {
deviceIds: ["laptop_large"],
monitorOptions: {},
restrictedRoles: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],
retry: {},
},
status: "live",
Expand Down
3 changes: 3 additions & 0 deletions examples/v1/synthetics/UpdatePrivateLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const apiInstance = new v1.SyntheticsApi(configuration);
const params: v1.SyntheticsApiUpdatePrivateLocationRequest = {
body: {
description: "Description of private location",
metadata: {
restrictedRoles: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],
},
name: "New private location",
tags: ["team:front"],
},
Expand Down
Loading