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

[monitors] Deprecate locked property and clarify documentation for restricted_roles #579

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-03-15 09:31:17.058796",
"spec_repo_commit": "80288098"
"regenerated": "2022-03-16 14:22:23.152710",
"spec_repo_commit": "a7afd4c8"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-03-15 09:31:17.076309",
"spec_repo_commit": "80288098"
"regenerated": "2022-03-16 14:22:23.173343",
"spec_repo_commit": "a7afd4c8"
}
}
}
19 changes: 14 additions & 5 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5619,8 +5619,12 @@ components:
example: avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100
type: string
restricted_roles:
description: A list of role identifiers that can be pulled from the Roles
API. Cannot be used with `locked` option.
description: A list of unique role identifiers to define which roles are
allowed to edit the monitor. Editing a monitor includes any updates to
the monitor configuration, monitor deletion, and muting of the monitor
for any amount of time. Roles unique identifiers can be pulled from the
[Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) in
the `data.id` field.
items:
description: A role UUID.
type: string
Expand Down Expand Up @@ -5945,8 +5949,9 @@ components:
- If `False`, `[Triggered] Monitor Title`'
type: boolean
locked:
deprecated: true
description: Whether or not the monitor is locked (only editable by creator
and admins).
and admins). Use `restricted_roles` instead.
type: boolean
min_failure_duration:
default: 0
Expand Down Expand Up @@ -6553,8 +6558,12 @@ components:
description: The monitor query.
type: string
restricted_roles:
description: A list of role identifiers that can be pulled from the Roles
API. Cannot be used with `locked` option.
description: A list of unique role identifiers to define which roles are
allowed to edit the monitor. Editing a monitor includes any updates to
the monitor configuration, monitor deletion, and muting of the monitor
for any amount of time. Roles unique identifiers can be pulled from the
[Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) in
the `data.id` field.
items:
description: A role UUID.
type: string
Expand Down
19 changes: 10 additions & 9 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ components:
format: int64
type: integer
RoleID:
description: The ID of the role.
description: The unique identifier of the role.
in: path
name: role_id
required: true
Expand Down Expand Up @@ -4851,7 +4851,7 @@ components:
description: Relationship to role object.
properties:
id:
description: ID of the role.
description: The unique identifier of the role.
example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d
type: string
type:
Expand All @@ -4861,7 +4861,7 @@ components:
description: Relationship to roles.
properties:
data:
description: An array containing type and ID of a role.
description: An array containing type and the unique identifier of a role.
items:
$ref: '#/components/schemas/RelationshipToRoleData'
type: array
Expand Down Expand Up @@ -4934,7 +4934,7 @@ components:
attributes:
$ref: '#/components/schemas/RoleAttributes'
id:
description: ID of the role.
description: The unique identifier of the role.
type: string
relationships:
$ref: '#/components/schemas/RoleResponseRelationships'
Expand All @@ -4957,7 +4957,8 @@ components:
readOnly: true
type: string
name:
description: Name of the role.
description: The name of the role. The name is neither unique nor a stable
identifier of the role.
type: string
user_count:
description: Number of users with that role.
Expand Down Expand Up @@ -5047,7 +5048,7 @@ components:
attributes:
$ref: '#/components/schemas/RoleCreateAttributes'
id:
description: ID of the role.
description: The unique identifier of the role.
type: string
relationships:
$ref: '#/components/schemas/RoleResponseRelationships'
Expand Down Expand Up @@ -5099,7 +5100,7 @@ components:
attributes:
$ref: '#/components/schemas/RoleUpdateAttributes'
id:
description: ID of the role.
description: The unique identifier of the role.
example: 00000000-0000-1111-0000-000000000000
type: string
type:
Expand Down Expand Up @@ -5129,7 +5130,7 @@ components:
attributes:
$ref: '#/components/schemas/RoleUpdateAttributes'
id:
description: ID of the role.
description: The unique identifier of the role.
type: string
relationships:
$ref: '#/components/schemas/RoleResponseRelationships'
Expand Down Expand Up @@ -9437,7 +9438,7 @@ paths:
type: safe
/api/v2/roles:
get:
description: Returns all roles, including their names and IDs.
description: Returns all roles, including their names and their unique identifiers.
operationId: ListRoles
parameters:
- $ref: '#/components/parameters/PageSize'
Expand Down
2 changes: 1 addition & 1 deletion packages/datadog-api-client-v1/models/Monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class Monitor {
*/
"query": string;
/**
* A list of role identifiers that can be pulled from the Roles API. Cannot be used with `locked` option.
* A list of unique role identifiers to define which roles are allowed to edit the monitor. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. Roles unique identifiers can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) in the `data.id` field.
*/
"restrictedRoles"?: Array<string>;
"state"?: MonitorState;
Expand Down
2 changes: 1 addition & 1 deletion packages/datadog-api-client-v1/models/MonitorOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class MonitorOptions {
*/
"includeTags"?: boolean;
/**
* Whether or not the monitor is locked (only editable by creator and admins).
* Whether or not the monitor is locked (only editable by creator and admins). Use `restricted_roles` instead.
*/
"locked"?: boolean;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class MonitorUpdateRequest {
*/
"query"?: string;
/**
* A list of role identifiers that can be pulled from the Roles API. Cannot be used with `locked` option.
* A list of unique role identifiers to define which roles are allowed to edit the monitor. Editing a monitor includes any updates to the monitor configuration, monitor deletion, and muting of the monitor for any amount of time. Roles unique identifiers can be pulled from the [Roles API](https://docs.datadoghq.com/api/latest/roles/#list-roles) in the `data.id` field.
*/
"restrictedRoles"?: Array<string>;
"state"?: MonitorState;
Expand Down
22 changes: 11 additions & 11 deletions packages/datadog-api-client-v2/apis/RolesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ export class RolesApiResponseProcessor {

export interface RolesApiAddPermissionToRoleRequest {
/**
* The ID of the role.
* The unique identifier of the role.
* @type string
*/
roleId: string;
Expand All @@ -1545,7 +1545,7 @@ export interface RolesApiAddPermissionToRoleRequest {

export interface RolesApiAddUserToRoleRequest {
/**
* The ID of the role.
* The unique identifier of the role.
* @type string
*/
roleId: string;
Expand All @@ -1558,7 +1558,7 @@ export interface RolesApiAddUserToRoleRequest {

export interface RolesApiCloneRoleRequest {
/**
* The ID of the role.
* The unique identifier of the role.
* @type string
*/
roleId: string;
Expand All @@ -1579,31 +1579,31 @@ export interface RolesApiCreateRoleRequest {

export interface RolesApiDeleteRoleRequest {
/**
* The ID of the role.
* The unique identifier of the role.
* @type string
*/
roleId: string;
}

export interface RolesApiGetRoleRequest {
/**
* The ID of the role.
* The unique identifier of the role.
* @type string
*/
roleId: string;
}

export interface RolesApiListRolePermissionsRequest {
/**
* The ID of the role.
* The unique identifier of the role.
* @type string
*/
roleId: string;
}

export interface RolesApiListRoleUsersRequest {
/**
* The ID of the role.
* The unique identifier of the role.
* @type string
*/
roleId: string;
Expand Down Expand Up @@ -1654,7 +1654,7 @@ export interface RolesApiListRolesRequest {

export interface RolesApiRemovePermissionFromRoleRequest {
/**
* The ID of the role.
* The unique identifier of the role.
* @type string
*/
roleId: string;
Expand All @@ -1667,7 +1667,7 @@ export interface RolesApiRemovePermissionFromRoleRequest {

export interface RolesApiRemoveUserFromRoleRequest {
/**
* The ID of the role.
* The unique identifier of the role.
* @type string
*/
roleId: string;
Expand All @@ -1680,7 +1680,7 @@ export interface RolesApiRemoveUserFromRoleRequest {

export interface RolesApiUpdateRoleRequest {
/**
* The ID of the role.
* The unique identifier of the role.
* @type string
*/
roleId: string;
Expand Down Expand Up @@ -1901,7 +1901,7 @@ export class RolesApi {
}

/**
* Returns all roles, including their names and IDs.
* Returns all roles, including their names and their unique identifiers.
* @param param The request object
*/
public listRoles(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { AttributeTypeMap } from "./ObjectSerializer";

export class RelationshipToRoleData {
/**
* ID of the role.
* The unique identifier of the role.
*/
"id"?: string;
"type"?: RolesType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { AttributeTypeMap } from "./ObjectSerializer";

export class RelationshipToRoles {
/**
* An array containing type and ID of a role.
* An array containing type and the unique identifier of a role.
*/
"data"?: Array<RelationshipToRoleData>;

Expand Down
2 changes: 1 addition & 1 deletion packages/datadog-api-client-v2/models/Role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { AttributeTypeMap } from "./ObjectSerializer";
export class Role {
"attributes"?: RoleAttributes;
/**
* ID of the role.
* The unique identifier of the role.
*/
"id"?: string;
"relationships"?: RoleResponseRelationships;
Expand Down
2 changes: 1 addition & 1 deletion packages/datadog-api-client-v2/models/RoleAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class RoleAttributes {
*/
"modifiedAt"?: Date;
/**
* Name of the role.
* The name of the role. The name is neither unique nor a stable identifier of the role.
*/
"name"?: string;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { AttributeTypeMap } from "./ObjectSerializer";
export class RoleCreateResponseData {
"attributes"?: RoleCreateAttributes;
/**
* ID of the role.
* The unique identifier of the role.
*/
"id"?: string;
"relationships"?: RoleResponseRelationships;
Expand Down
2 changes: 1 addition & 1 deletion packages/datadog-api-client-v2/models/RoleUpdateData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { AttributeTypeMap } from "./ObjectSerializer";
export class RoleUpdateData {
"attributes": RoleUpdateAttributes;
/**
* ID of the role.
* The unique identifier of the role.
*/
"id": string;
"type": RolesType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { AttributeTypeMap } from "./ObjectSerializer";
export class RoleUpdateResponseData {
"attributes"?: RoleUpdateAttributes;
/**
* ID of the role.
* The unique identifier of the role.
*/
"id"?: string;
"relationships"?: RoleResponseRelationships;
Expand Down