diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 7ab82fd266..c7157d9253 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -71412,6 +71412,416 @@ components: $ref: "#/components/schemas/SyntheticsApiMultistepSubtestData" type: array type: object + SyntheticsDowntimeData: + description: A Synthetics downtime object. + properties: + attributes: + $ref: "#/components/schemas/SyntheticsDowntimeDataAttributesResponse" + id: + description: The unique identifier of the downtime. + example: "00000000-0000-0000-0000-000000000001" + type: string + type: + $ref: "#/components/schemas/SyntheticsDowntimeResourceType" + required: + - id + - type + - attributes + type: object + SyntheticsDowntimeDataAttributesRequest: + description: Attributes for creating or updating a Synthetics downtime. + properties: + description: + description: An optional description of the downtime. + example: Scheduled weekly maintenance window. + type: string + isEnabled: + description: Whether the downtime is enabled. + example: true + type: boolean + name: + description: The name of the downtime. + example: Weekly maintenance + type: string + tags: + $ref: "#/components/schemas/SyntheticsDowntimeTags" + testIds: + $ref: "#/components/schemas/SyntheticsDowntimeTestIds" + timeSlots: + $ref: "#/components/schemas/SyntheticsDowntimeTimeSlotRequests" + required: + - name + - isEnabled + - timeSlots + - testIds + type: object + SyntheticsDowntimeDataAttributesResponse: + description: Attributes of a Synthetics downtime response object. + properties: + createdAt: + description: The timestamp when the downtime was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + createdBy: + description: The UUID of the user who created the downtime. + example: "00000000-0000-0000-0000-000000000003" + type: string + createdByName: + description: The display name of the user who created the downtime. + example: Jane Doe + type: string + description: + description: The description of the downtime. + example: Scheduled weekly maintenance window. + type: string + isEnabled: + description: Whether the downtime is enabled. + example: true + type: boolean + name: + description: The name of the downtime. + example: Weekly maintenance + type: string + tags: + $ref: "#/components/schemas/SyntheticsDowntimeTags" + testIds: + $ref: "#/components/schemas/SyntheticsDowntimeTestIds" + timeSlots: + $ref: "#/components/schemas/SyntheticsDowntimeTimeSlotResponses" + updatedAt: + description: The timestamp when the downtime was last updated. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + updatedBy: + description: The UUID of the user who last updated the downtime. + example: "00000000-0000-0000-0000-000000000003" + type: string + updatedByName: + description: The display name of the user who last updated the downtime. + example: Jane Doe + type: string + required: + - name + - description + - isEnabled + - createdBy + - createdByName + - createdAt + - updatedBy + - updatedByName + - updatedAt + - timeSlots + - testIds + - tags + type: object + SyntheticsDowntimeDataList: + description: List of Synthetics downtime objects. + example: + - attributes: + createdAt: "2024-01-15T10:30:00Z" + createdBy: "00000000-0000-0000-0000-000000000003" + createdByName: Jane Doe + description: Scheduled weekly maintenance window. + isEnabled: true + name: Weekly maintenance + tags: [] + testIds: + - abc-def-123 + timeSlots: + - duration: 3600 + id: "00000000-0000-0000-0000-000000000002" + start: + day: 15 + hour: 10 + minute: 30 + month: 1 + year: 2024 + timezone: Europe/Paris + updatedAt: "2024-01-15T10:30:00Z" + updatedBy: "00000000-0000-0000-0000-000000000003" + updatedByName: Jane Doe + id: "00000000-0000-0000-0000-000000000001" + type: downtime + items: + $ref: "#/components/schemas/SyntheticsDowntimeData" + type: array + SyntheticsDowntimeDataRequest: + description: The data object for a Synthetics downtime create or update request. + example: + attributes: + isEnabled: true + name: Weekly maintenance + testIds: + - abc-def-123 + timeSlots: + - duration: 3600 + start: + day: 15 + hour: 10 + minute: 30 + month: 1 + year: 2024 + timezone: Europe/Paris + type: downtime + properties: + attributes: + $ref: "#/components/schemas/SyntheticsDowntimeDataAttributesRequest" + type: + $ref: "#/components/schemas/SyntheticsDowntimeResourceType" + required: + - type + - attributes + type: object + SyntheticsDowntimeFrequency: + description: The recurrence frequency of a Synthetics downtime time slot. + enum: + - DAILY + - WEEKLY + - MONTHLY + - YEARLY + example: WEEKLY + type: string + x-enum-varnames: + - DAILY + - WEEKLY + - MONTHLY + - YEARLY + SyntheticsDowntimeRequest: + description: Request body for creating or updating a Synthetics downtime. + properties: + data: + $ref: "#/components/schemas/SyntheticsDowntimeDataRequest" + required: + - data + type: object + SyntheticsDowntimeResourceType: + description: The resource type for a Synthetics downtime. + enum: + - downtime + example: downtime + type: string + x-enum-varnames: + - DOWNTIME + SyntheticsDowntimeResponse: + description: Response containing a single Synthetics downtime. + properties: + data: + $ref: "#/components/schemas/SyntheticsDowntimeData" + required: + - data + type: object + SyntheticsDowntimeTags: + description: List of tags associated with a Synthetics downtime. + example: + - "team:backend" + - "env:prod" + items: + description: A tag. + type: string + type: array + SyntheticsDowntimeTestIds: + description: List of Synthetics test public IDs associated with a downtime. + example: + - abc-def-123 + - xyz-uvw-456 + items: + description: A Synthetics test public ID. + type: string + type: array + SyntheticsDowntimeTimeSlotDate: + description: A specific date and time used to define the start or end of a Synthetics downtime time slot. + properties: + day: + description: The day component of the date (1-31). + example: 15 + format: int64 + type: integer + hour: + description: The hour component of the time (0-23). + example: 10 + format: int64 + type: integer + minute: + description: The minute component of the time (0-59). + example: 30 + format: int64 + type: integer + month: + description: The month component of the date (1-12). + example: 1 + format: int64 + type: integer + year: + description: The year component of the date. + example: 2024 + format: int64 + type: integer + required: + - year + - month + - day + - hour + - minute + type: object + SyntheticsDowntimeTimeSlotRecurrenceRequest: + description: Recurrence settings for a Synthetics downtime time slot. + properties: + end: + $ref: "#/components/schemas/SyntheticsDowntimeTimeSlotDate" + frequency: + $ref: "#/components/schemas/SyntheticsDowntimeFrequency" + interval: + description: The interval between recurrences, relative to the frequency. + example: 1 + format: int64 + type: integer + weekdays: + $ref: "#/components/schemas/SyntheticsDowntimeWeekdays" + required: + - frequency + type: object + SyntheticsDowntimeTimeSlotRecurrenceResponse: + description: Recurrence settings returned in a Synthetics downtime time slot response. + properties: + frequency: + $ref: "#/components/schemas/SyntheticsDowntimeFrequency" + interval: + description: The interval between recurrences, relative to the frequency. + example: 1 + format: int64 + type: integer + until: + $ref: "#/components/schemas/SyntheticsDowntimeTimeSlotDate" + weekdays: + $ref: "#/components/schemas/SyntheticsDowntimeWeekdays" + required: + - frequency + - interval + - weekdays + type: object + SyntheticsDowntimeTimeSlotRequest: + description: A time slot for a Synthetics downtime create or update request. + properties: + duration: + description: The duration of the time slot in seconds, between 60 and 604800. + example: 3600 + format: int64 + type: integer + name: + description: An optional label for the time slot. + example: Weekly maintenance window + type: string + recurrence: + $ref: "#/components/schemas/SyntheticsDowntimeTimeSlotRecurrenceRequest" + start: + $ref: "#/components/schemas/SyntheticsDowntimeTimeSlotDate" + timezone: + description: The IANA timezone name for the time slot. + example: Europe/Paris + type: string + required: + - start + - timezone + - duration + type: object + SyntheticsDowntimeTimeSlotRequests: + description: List of time slots for a Synthetics downtime create or update request. + example: + - duration: 3600 + start: + day: 15 + hour: 10 + minute: 30 + month: 1 + year: 2024 + timezone: Europe/Paris + items: + $ref: "#/components/schemas/SyntheticsDowntimeTimeSlotRequest" + type: array + SyntheticsDowntimeTimeSlotResponse: + description: A time slot returned in a Synthetics downtime response. + properties: + duration: + description: The duration of the time slot in seconds. + example: 3600 + format: int64 + type: integer + id: + description: The unique identifier of the time slot. + example: "00000000-0000-0000-0000-000000000002" + type: string + name: + description: The label for the time slot. + example: Weekly maintenance window + type: string + recurrence: + $ref: "#/components/schemas/SyntheticsDowntimeTimeSlotRecurrenceResponse" + start: + $ref: "#/components/schemas/SyntheticsDowntimeTimeSlotDate" + timezone: + description: The IANA timezone name for the time slot. + example: Europe/Paris + type: string + required: + - id + - start + - timezone + - duration + type: object + SyntheticsDowntimeTimeSlotResponses: + description: List of time slots in a Synthetics downtime response. + example: + - duration: 3600 + id: "00000000-0000-0000-0000-000000000002" + start: + day: 15 + hour: 10 + minute: 30 + month: 1 + year: 2024 + timezone: Europe/Paris + items: + $ref: "#/components/schemas/SyntheticsDowntimeTimeSlotResponse" + type: array + SyntheticsDowntimeWeekday: + description: A day of the week for a Synthetics downtime recurrence. + enum: + - MO + - TU + - WE + - TH + - FR + - SA + - SU + example: MO + type: string + x-enum-varnames: + - MONDAY + - TUESDAY + - WEDNESDAY + - THURSDAY + - FRIDAY + - SATURDAY + - SUNDAY + SyntheticsDowntimeWeekdays: + description: Days of the week for a Synthetics downtime recurrence schedule. + example: + - MO + - WE + - FR + items: + $ref: "#/components/schemas/SyntheticsDowntimeWeekday" + type: array + SyntheticsDowntimesResponse: + description: Response containing a list of Synthetics downtimes. + properties: + data: + $ref: "#/components/schemas/SyntheticsDowntimeDataList" + required: + - data + type: object SyntheticsFastTestResult: description: |- Fast test result response. Returns `null` if the result is not yet available @@ -126899,6 +127309,545 @@ paths: operator: OR permissions: - synthetics_read + /api/v2/synthetics/downtimes: + get: + description: Get a list of all Synthetics downtimes for your organization. + operationId: ListSyntheticsDowntimes + parameters: + - description: Comma-separated list of Synthetics test public IDs to filter downtimes by. + in: query + name: filter[test_ids] + required: false + schema: + example: abc-def-123,xyz-uvw-456 + type: string + - description: If set to `true`, return only downtimes that are currently active. + in: query + name: filter[active] + required: false + schema: + example: "true" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + createdAt: "2024-01-15T10:30:00Z" + createdBy: "00000000-0000-0000-0000-000000000003" + createdByName: Jane Doe + description: Scheduled weekly maintenance window. + isEnabled: true + name: Weekly maintenance + tags: [] + testIds: + - abc-def-123 + timeSlots: + - duration: 3600 + id: "00000000-0000-0000-0000-000000000002" + start: + day: 15 + hour: 10 + minute: 30 + month: 1 + year: 2024 + timezone: Europe/Paris + updatedAt: "2024-01-15T10:30:00Z" + updatedBy: "00000000-0000-0000-0000-000000000003" + updatedByName: Jane Doe + id: "00000000-0000-0000-0000-000000000001" + type: downtime + schema: + $ref: "#/components/schemas/SyntheticsDowntimesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List Synthetics downtimes + tags: + - Synthetics + x-permission: + operator: AND + permissions: + - synthetics_read + post: + description: Create a new Synthetics downtime. + operationId: CreateSyntheticsDowntime + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + isEnabled: true + name: Weekly maintenance + testIds: + - abc-def-123 + timeSlots: + - duration: 3600 + start: + day: 15 + hour: 10 + minute: 30 + month: 1 + year: 2024 + timezone: Europe/Paris + type: downtime + schema: + $ref: "#/components/schemas/SyntheticsDowntimeRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + createdAt: "2024-01-15T10:30:00Z" + createdBy: "00000000-0000-0000-0000-000000000003" + createdByName: Jane Doe + description: Scheduled weekly maintenance window. + isEnabled: true + name: Weekly maintenance + tags: [] + testIds: + - abc-def-123 + timeSlots: + - duration: 3600 + id: "00000000-0000-0000-0000-000000000002" + start: + day: 15 + hour: 10 + minute: 30 + month: 1 + year: 2024 + timezone: Europe/Paris + updatedAt: "2024-01-15T10:30:00Z" + updatedBy: "00000000-0000-0000-0000-000000000003" + updatedByName: Jane Doe + id: "00000000-0000-0000-0000-000000000001" + type: downtime + schema: + $ref: "#/components/schemas/SyntheticsDowntimeResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a Synthetics downtime + tags: + - Synthetics + x-permission: + operator: AND + permissions: + - synthetics_write + /api/v2/synthetics/downtimes/{downtime_id}: + delete: + description: Delete a Synthetics downtime by its ID. + operationId: DeleteSyntheticsDowntime + parameters: + - description: The ID of the downtime to delete. + in: path + name: downtime_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000001" + type: string + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a Synthetics downtime + tags: + - Synthetics + x-permission: + operator: AND + permissions: + - synthetics_write + get: + description: Get a Synthetics downtime by its ID. + operationId: GetSyntheticsDowntime + parameters: + - description: The ID of the downtime to retrieve. + in: path + name: downtime_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000001" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + createdAt: "2024-01-15T10:30:00Z" + createdBy: "00000000-0000-0000-0000-000000000003" + createdByName: Jane Doe + description: Scheduled weekly maintenance window. + isEnabled: true + name: Weekly maintenance + tags: [] + testIds: + - abc-def-123 + timeSlots: + - duration: 3600 + id: "00000000-0000-0000-0000-000000000002" + start: + day: 15 + hour: 10 + minute: 30 + month: 1 + year: 2024 + timezone: Europe/Paris + updatedAt: "2024-01-15T10:30:00Z" + updatedBy: "00000000-0000-0000-0000-000000000003" + updatedByName: Jane Doe + id: "00000000-0000-0000-0000-000000000001" + type: downtime + schema: + $ref: "#/components/schemas/SyntheticsDowntimeResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a Synthetics downtime + tags: + - Synthetics + x-permission: + operator: AND + permissions: + - synthetics_read + put: + description: Update a Synthetics downtime by its ID. + operationId: UpdateSyntheticsDowntime + parameters: + - description: The ID of the downtime to update. + in: path + name: downtime_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000001" + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + isEnabled: true + name: Weekly maintenance + testIds: + - abc-def-123 + timeSlots: + - duration: 3600 + start: + day: 15 + hour: 10 + minute: 30 + month: 1 + year: 2024 + timezone: Europe/Paris + type: downtime + schema: + $ref: "#/components/schemas/SyntheticsDowntimeRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + createdAt: "2024-01-15T10:30:00Z" + createdBy: "00000000-0000-0000-0000-000000000003" + createdByName: Jane Doe + description: Scheduled weekly maintenance window. + isEnabled: true + name: Weekly maintenance + tags: [] + testIds: + - abc-def-123 + timeSlots: + - duration: 3600 + id: "00000000-0000-0000-0000-000000000002" + start: + day: 15 + hour: 10 + minute: 30 + month: 1 + year: 2024 + timezone: Europe/Paris + updatedAt: "2024-01-15T10:30:00Z" + updatedBy: "00000000-0000-0000-0000-000000000003" + updatedByName: Jane Doe + id: "00000000-0000-0000-0000-000000000001" + type: downtime + schema: + $ref: "#/components/schemas/SyntheticsDowntimeResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a Synthetics downtime + tags: + - Synthetics + x-permission: + operator: AND + permissions: + - synthetics_write + /api/v2/synthetics/downtimes/{downtime_id}/tests/{test_id}: + delete: + description: Disassociate a Synthetics test from a downtime. + operationId: RemoveTestFromSyntheticsDowntime + parameters: + - description: The ID of the downtime. + in: path + name: downtime_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000001" + type: string + - description: The public ID of the Synthetics test to disassociate from the downtime. + in: path + name: test_id + required: true + schema: + example: abc-def-123 + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + createdAt: "2024-01-15T10:30:00Z" + createdBy: "00000000-0000-0000-0000-000000000003" + createdByName: Jane Doe + description: Scheduled weekly maintenance window. + isEnabled: true + name: Weekly maintenance + tags: [] + testIds: + - abc-def-123 + timeSlots: + - duration: 3600 + id: "00000000-0000-0000-0000-000000000002" + start: + day: 15 + hour: 10 + minute: 30 + month: 1 + year: 2024 + timezone: Europe/Paris + updatedAt: "2024-01-15T10:30:00Z" + updatedBy: "00000000-0000-0000-0000-000000000003" + updatedByName: Jane Doe + id: "00000000-0000-0000-0000-000000000001" + type: downtime + schema: + $ref: "#/components/schemas/SyntheticsDowntimeResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Remove a test from a Synthetics downtime + tags: + - Synthetics + x-permission: + operator: AND + permissions: + - synthetics_write + put: + description: Associate a Synthetics test with a downtime. + operationId: AddTestToSyntheticsDowntime + parameters: + - description: The ID of the downtime. + in: path + name: downtime_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000001" + type: string + - description: The public ID of the Synthetics test to associate with the downtime. + in: path + name: test_id + required: true + schema: + example: abc-def-123 + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + createdAt: "2024-01-15T10:30:00Z" + createdBy: "00000000-0000-0000-0000-000000000003" + createdByName: Jane Doe + description: Scheduled weekly maintenance window. + isEnabled: true + name: Weekly maintenance + tags: [] + testIds: + - abc-def-123 + timeSlots: + - duration: 3600 + id: "00000000-0000-0000-0000-000000000002" + start: + day: 15 + hour: 10 + minute: 30 + month: 1 + year: 2024 + timezone: Europe/Paris + updatedAt: "2024-01-15T10:30:00Z" + updatedBy: "00000000-0000-0000-0000-000000000003" + updatedByName: Jane Doe + id: "00000000-0000-0000-0000-000000000001" + type: downtime + schema: + $ref: "#/components/schemas/SyntheticsDowntimeResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Add a test to a Synthetics downtime + tags: + - Synthetics + x-permission: + operator: AND + permissions: + - synthetics_write /api/v2/synthetics/settings/on_demand_concurrency_cap: get: description: Get the on-demand concurrency cap. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 8881ab2d99..856e1a6011 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -31868,6 +31868,111 @@ datadog\_api\_client.v2.model.synthetics\_api\_multistep\_subtests\_response mod :members: :show-inheritance: +datadog\_api\_client.v2.model.synthetics\_downtime\_data module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_downtime_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_downtime\_data\_attributes\_request module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.synthetics_downtime_data_attributes_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_downtime\_data\_attributes\_response module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_downtime_data_attributes_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_downtime\_data\_request module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.synthetics_downtime_data_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_downtime\_frequency module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_downtime_frequency + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_downtime\_request module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.synthetics_downtime_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_downtime\_resource\_type module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_downtime_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_downtime\_response module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_downtime_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_downtime\_time\_slot\_date module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_downtime_time_slot_date + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_downtime\_time\_slot\_recurrence\_request module +------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.synthetics_downtime_time_slot_recurrence_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_downtime\_time\_slot\_recurrence\_response module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_downtime_time_slot_recurrence_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_downtime\_time\_slot\_request module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.synthetics_downtime_time_slot_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_downtime\_time\_slot\_response module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_downtime_time_slot_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_downtime\_weekday module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.synthetics_downtime_weekday + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.synthetics\_downtimes\_response module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.synthetics_downtimes_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.synthetics\_fast\_test\_result module ------------------------------------------------------------------- diff --git a/examples/v2/synthetics/AddTestToSyntheticsDowntime.py b/examples/v2/synthetics/AddTestToSyntheticsDowntime.py new file mode 100644 index 0000000000..85802f956b --- /dev/null +++ b/examples/v2/synthetics/AddTestToSyntheticsDowntime.py @@ -0,0 +1,16 @@ +""" +Add a test to a Synthetics downtime returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.synthetics_api import SyntheticsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SyntheticsApi(api_client) + response = api_instance.add_test_to_synthetics_downtime( + downtime_id="00000000-0000-0000-0000-000000000001", + test_id="abc-def-123", + ) + + print(response) diff --git a/examples/v2/synthetics/CreateSyntheticsDowntime.py b/examples/v2/synthetics/CreateSyntheticsDowntime.py new file mode 100644 index 0000000000..dcd76479c7 --- /dev/null +++ b/examples/v2/synthetics/CreateSyntheticsDowntime.py @@ -0,0 +1,47 @@ +""" +Create a Synthetics downtime returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.synthetics_api import SyntheticsApi +from datadog_api_client.v2.model.synthetics_downtime_data_attributes_request import ( + SyntheticsDowntimeDataAttributesRequest, +) +from datadog_api_client.v2.model.synthetics_downtime_data_request import SyntheticsDowntimeDataRequest +from datadog_api_client.v2.model.synthetics_downtime_request import SyntheticsDowntimeRequest +from datadog_api_client.v2.model.synthetics_downtime_resource_type import SyntheticsDowntimeResourceType +from datadog_api_client.v2.model.synthetics_downtime_time_slot_date import SyntheticsDowntimeTimeSlotDate +from datadog_api_client.v2.model.synthetics_downtime_time_slot_request import SyntheticsDowntimeTimeSlotRequest + +body = SyntheticsDowntimeRequest( + data=SyntheticsDowntimeDataRequest( + attributes=SyntheticsDowntimeDataAttributesRequest( + is_enabled=True, + name="Weekly maintenance", + test_ids=[ + "abc-def-123", + ], + time_slots=[ + SyntheticsDowntimeTimeSlotRequest( + duration=3600, + start=SyntheticsDowntimeTimeSlotDate( + day=15, + hour=10, + minute=30, + month=1, + year=2024, + ), + timezone="Europe/Paris", + ), + ], + ), + type=SyntheticsDowntimeResourceType.DOWNTIME, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SyntheticsApi(api_client) + response = api_instance.create_synthetics_downtime(body=body) + + print(response) diff --git a/examples/v2/synthetics/DeleteSyntheticsDowntime.py b/examples/v2/synthetics/DeleteSyntheticsDowntime.py new file mode 100644 index 0000000000..42cbb85a73 --- /dev/null +++ b/examples/v2/synthetics/DeleteSyntheticsDowntime.py @@ -0,0 +1,13 @@ +""" +Delete a Synthetics downtime returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.synthetics_api import SyntheticsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SyntheticsApi(api_client) + api_instance.delete_synthetics_downtime( + downtime_id="00000000-0000-0000-0000-000000000001", + ) diff --git a/examples/v2/synthetics/GetSyntheticsDowntime.py b/examples/v2/synthetics/GetSyntheticsDowntime.py new file mode 100644 index 0000000000..f4f7435d95 --- /dev/null +++ b/examples/v2/synthetics/GetSyntheticsDowntime.py @@ -0,0 +1,15 @@ +""" +Get a Synthetics downtime returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.synthetics_api import SyntheticsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SyntheticsApi(api_client) + response = api_instance.get_synthetics_downtime( + downtime_id="00000000-0000-0000-0000-000000000001", + ) + + print(response) diff --git a/examples/v2/synthetics/ListSyntheticsDowntimes.py b/examples/v2/synthetics/ListSyntheticsDowntimes.py new file mode 100644 index 0000000000..7ece82047c --- /dev/null +++ b/examples/v2/synthetics/ListSyntheticsDowntimes.py @@ -0,0 +1,13 @@ +""" +List Synthetics downtimes returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.synthetics_api import SyntheticsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SyntheticsApi(api_client) + response = api_instance.list_synthetics_downtimes() + + print(response) diff --git a/examples/v2/synthetics/RemoveTestFromSyntheticsDowntime.py b/examples/v2/synthetics/RemoveTestFromSyntheticsDowntime.py new file mode 100644 index 0000000000..a4295652df --- /dev/null +++ b/examples/v2/synthetics/RemoveTestFromSyntheticsDowntime.py @@ -0,0 +1,16 @@ +""" +Remove a test from a Synthetics downtime returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.synthetics_api import SyntheticsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SyntheticsApi(api_client) + response = api_instance.remove_test_from_synthetics_downtime( + downtime_id="00000000-0000-0000-0000-000000000001", + test_id="abc-def-123", + ) + + print(response) diff --git a/examples/v2/synthetics/UpdateSyntheticsDowntime.py b/examples/v2/synthetics/UpdateSyntheticsDowntime.py new file mode 100644 index 0000000000..4428b2d075 --- /dev/null +++ b/examples/v2/synthetics/UpdateSyntheticsDowntime.py @@ -0,0 +1,47 @@ +""" +Update a Synthetics downtime returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.synthetics_api import SyntheticsApi +from datadog_api_client.v2.model.synthetics_downtime_data_attributes_request import ( + SyntheticsDowntimeDataAttributesRequest, +) +from datadog_api_client.v2.model.synthetics_downtime_data_request import SyntheticsDowntimeDataRequest +from datadog_api_client.v2.model.synthetics_downtime_request import SyntheticsDowntimeRequest +from datadog_api_client.v2.model.synthetics_downtime_resource_type import SyntheticsDowntimeResourceType +from datadog_api_client.v2.model.synthetics_downtime_time_slot_date import SyntheticsDowntimeTimeSlotDate +from datadog_api_client.v2.model.synthetics_downtime_time_slot_request import SyntheticsDowntimeTimeSlotRequest + +body = SyntheticsDowntimeRequest( + data=SyntheticsDowntimeDataRequest( + attributes=SyntheticsDowntimeDataAttributesRequest( + is_enabled=True, + name="Weekly maintenance", + test_ids=[ + "abc-def-123", + ], + time_slots=[ + SyntheticsDowntimeTimeSlotRequest( + duration=3600, + start=SyntheticsDowntimeTimeSlotDate( + day=15, + hour=10, + minute=30, + month=1, + year=2024, + ), + timezone="Europe/Paris", + ), + ], + ), + type=SyntheticsDowntimeResourceType.DOWNTIME, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = SyntheticsApi(api_client) + response = api_instance.update_synthetics_downtime(downtime_id="00000000-0000-0000-0000-000000000001", body=body) + + print(response) diff --git a/src/datadog_api_client/v2/api/synthetics_api.py b/src/datadog_api_client/v2/api/synthetics_api.py index a75ed0ee34..497a0d471b 100644 --- a/src/datadog_api_client/v2/api/synthetics_api.py +++ b/src/datadog_api_client/v2/api/synthetics_api.py @@ -17,6 +17,9 @@ from datadog_api_client.v2.model.synthetics_api_multistep_parent_tests_response import ( SyntheticsApiMultistepParentTestsResponse, ) +from datadog_api_client.v2.model.synthetics_downtimes_response import SyntheticsDowntimesResponse +from datadog_api_client.v2.model.synthetics_downtime_response import SyntheticsDowntimeResponse +from datadog_api_client.v2.model.synthetics_downtime_request import SyntheticsDowntimeRequest from datadog_api_client.v2.model.on_demand_concurrency_cap_response import OnDemandConcurrencyCapResponse from datadog_api_client.v2.model.on_demand_concurrency_cap_attributes import OnDemandConcurrencyCapAttributes from datadog_api_client.v2.model.synthetics_suite_response import SyntheticsSuiteResponse @@ -99,6 +102,35 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._add_test_to_synthetics_downtime_endpoint = _Endpoint( + settings={ + "response_type": (SyntheticsDowntimeResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/synthetics/downtimes/{downtime_id}/tests/{test_id}", + "operation_id": "add_test_to_synthetics_downtime", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "downtime_id": { + "required": True, + "openapi_types": (str,), + "attribute": "downtime_id", + "location": "path", + }, + "test_id": { + "required": True, + "openapi_types": (str,), + "attribute": "test_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._complete_test_file_multipart_upload_endpoint = _Endpoint( settings={ "response_type": None, @@ -125,6 +157,26 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_synthetics_downtime_endpoint = _Endpoint( + settings={ + "response_type": (SyntheticsDowntimeResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/synthetics/downtimes", + "operation_id": "create_synthetics_downtime", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (SyntheticsDowntimeRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_synthetics_network_test_endpoint = _Endpoint( settings={ "response_type": (SyntheticsNetworkTestResponse,), @@ -165,6 +217,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_synthetics_downtime_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/synthetics/downtimes/{downtime_id}", + "operation_id": "delete_synthetics_downtime", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "downtime_id": { + "required": True, + "openapi_types": (str,), + "attribute": "downtime_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._delete_synthetics_suites_endpoint = _Endpoint( settings={ "response_type": (DeletedSuitesResponse,), @@ -332,6 +407,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_synthetics_downtime_endpoint = _Endpoint( + settings={ + "response_type": (SyntheticsDowntimeResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/synthetics/downtimes/{downtime_id}", + "operation_id": "get_synthetics_downtime", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "downtime_id": { + "required": True, + "openapi_types": (str,), + "attribute": "downtime_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_synthetics_fast_test_result_endpoint = _Endpoint( settings={ "response_type": (SyntheticsFastTestResult,), @@ -609,6 +707,33 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_synthetics_downtimes_endpoint = _Endpoint( + settings={ + "response_type": (SyntheticsDowntimesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/synthetics/downtimes", + "operation_id": "list_synthetics_downtimes", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "filter_test_ids": { + "openapi_types": (str,), + "attribute": "filter[test_ids]", + "location": "query", + }, + "filter_active": { + "openapi_types": (str,), + "attribute": "filter[active]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_synthetics_test_latest_results_endpoint = _Endpoint( settings={ "response_type": (SyntheticsTestLatestResultsResponse,), @@ -775,6 +900,35 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._remove_test_from_synthetics_downtime_endpoint = _Endpoint( + settings={ + "response_type": (SyntheticsDowntimeResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/synthetics/downtimes/{downtime_id}/tests/{test_id}", + "operation_id": "remove_test_from_synthetics_downtime", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "downtime_id": { + "required": True, + "openapi_types": (str,), + "attribute": "downtime_id", + "location": "path", + }, + "test_id": { + "required": True, + "openapi_types": (str,), + "attribute": "test_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._search_suites_endpoint = _Endpoint( settings={ "response_type": (SyntheticsSuiteSearchResponse,), @@ -837,6 +991,32 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_synthetics_downtime_endpoint = _Endpoint( + settings={ + "response_type": (SyntheticsDowntimeResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/synthetics/downtimes/{downtime_id}", + "operation_id": "update_synthetics_downtime", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "downtime_id": { + "required": True, + "openapi_types": (str,), + "attribute": "downtime_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (SyntheticsDowntimeRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._update_synthetics_network_test_endpoint = _Endpoint( settings={ "response_type": (SyntheticsNetworkTestResponse,), @@ -885,6 +1065,28 @@ def abort_test_file_multipart_upload( return self._abort_test_file_multipart_upload_endpoint.call_with_http_info(**kwargs) + def add_test_to_synthetics_downtime( + self, + downtime_id: str, + test_id: str, + ) -> SyntheticsDowntimeResponse: + """Add a test to a Synthetics downtime. + + Associate a Synthetics test with a downtime. + + :param downtime_id: The ID of the downtime. + :type downtime_id: str + :param test_id: The public ID of the Synthetics test to associate with the downtime. + :type test_id: str + :rtype: SyntheticsDowntimeResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["downtime_id"] = downtime_id + + kwargs["test_id"] = test_id + + return self._add_test_to_synthetics_downtime_endpoint.call_with_http_info(**kwargs) + def complete_test_file_multipart_upload( self, public_id: str, @@ -907,6 +1109,22 @@ def complete_test_file_multipart_upload( return self._complete_test_file_multipart_upload_endpoint.call_with_http_info(**kwargs) + def create_synthetics_downtime( + self, + body: SyntheticsDowntimeRequest, + ) -> SyntheticsDowntimeResponse: + """Create a Synthetics downtime. + + Create a new Synthetics downtime. + + :type body: SyntheticsDowntimeRequest + :rtype: SyntheticsDowntimeResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_synthetics_downtime_endpoint.call_with_http_info(**kwargs) + def create_synthetics_network_test( self, body: SyntheticsNetworkTestEditRequest, @@ -935,6 +1153,23 @@ def create_synthetics_suite( return self._create_synthetics_suite_endpoint.call_with_http_info(**kwargs) + def delete_synthetics_downtime( + self, + downtime_id: str, + ) -> None: + """Delete a Synthetics downtime. + + Delete a Synthetics downtime by its ID. + + :param downtime_id: The ID of the downtime to delete. + :type downtime_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["downtime_id"] = downtime_id + + return self._delete_synthetics_downtime_endpoint.call_with_http_info(**kwargs) + def delete_synthetics_suites( self, body: DeletedSuitesRequestDeleteRequest, @@ -1066,6 +1301,23 @@ def get_synthetics_browser_test_result( return self._get_synthetics_browser_test_result_endpoint.call_with_http_info(**kwargs) + def get_synthetics_downtime( + self, + downtime_id: str, + ) -> SyntheticsDowntimeResponse: + """Get a Synthetics downtime. + + Get a Synthetics downtime by its ID. + + :param downtime_id: The ID of the downtime to retrieve. + :type downtime_id: str + :rtype: SyntheticsDowntimeResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["downtime_id"] = downtime_id + + return self._get_synthetics_downtime_endpoint.call_with_http_info(**kwargs) + def get_synthetics_fast_test_result( self, id: str, @@ -1297,6 +1549,31 @@ def list_synthetics_browser_test_latest_results( return self._list_synthetics_browser_test_latest_results_endpoint.call_with_http_info(**kwargs) + def list_synthetics_downtimes( + self, + *, + filter_test_ids: Union[str, UnsetType] = unset, + filter_active: Union[str, UnsetType] = unset, + ) -> SyntheticsDowntimesResponse: + """List Synthetics downtimes. + + Get a list of all Synthetics downtimes for your organization. + + :param filter_test_ids: Comma-separated list of Synthetics test public IDs to filter downtimes by. + :type filter_test_ids: str, optional + :param filter_active: If set to ``true`` , return only downtimes that are currently active. + :type filter_active: str, optional + :rtype: SyntheticsDowntimesResponse + """ + kwargs: Dict[str, Any] = {} + if filter_test_ids is not unset: + kwargs["filter_test_ids"] = filter_test_ids + + if filter_active is not unset: + kwargs["filter_active"] = filter_active + + return self._list_synthetics_downtimes_endpoint.call_with_http_info(**kwargs) + def list_synthetics_test_latest_results( self, public_id: str, @@ -1458,6 +1735,28 @@ def poll_synthetics_test_results( return self._poll_synthetics_test_results_endpoint.call_with_http_info(**kwargs) + def remove_test_from_synthetics_downtime( + self, + downtime_id: str, + test_id: str, + ) -> SyntheticsDowntimeResponse: + """Remove a test from a Synthetics downtime. + + Disassociate a Synthetics test from a downtime. + + :param downtime_id: The ID of the downtime. + :type downtime_id: str + :param test_id: The public ID of the Synthetics test to disassociate from the downtime. + :type test_id: str + :rtype: SyntheticsDowntimeResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["downtime_id"] = downtime_id + + kwargs["test_id"] = test_id + + return self._remove_test_from_synthetics_downtime_endpoint.call_with_http_info(**kwargs) + def search_suites( self, *, @@ -1518,6 +1817,27 @@ def set_on_demand_concurrency_cap( return self._set_on_demand_concurrency_cap_endpoint.call_with_http_info(**kwargs) + def update_synthetics_downtime( + self, + downtime_id: str, + body: SyntheticsDowntimeRequest, + ) -> SyntheticsDowntimeResponse: + """Update a Synthetics downtime. + + Update a Synthetics downtime by its ID. + + :param downtime_id: The ID of the downtime to update. + :type downtime_id: str + :type body: SyntheticsDowntimeRequest + :rtype: SyntheticsDowntimeResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["downtime_id"] = downtime_id + + kwargs["body"] = body + + return self._update_synthetics_downtime_endpoint.call_with_http_info(**kwargs) + def update_synthetics_network_test( self, public_id: str, diff --git a/src/datadog_api_client/v2/model/synthetics_downtime_data.py b/src/datadog_api_client/v2/model/synthetics_downtime_data.py new file mode 100644 index 0000000000..6f99ad76d4 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_downtime_data.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_downtime_data_attributes_response import ( + SyntheticsDowntimeDataAttributesResponse, + ) + from datadog_api_client.v2.model.synthetics_downtime_resource_type import SyntheticsDowntimeResourceType + + +class SyntheticsDowntimeData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_downtime_data_attributes_response import ( + SyntheticsDowntimeDataAttributesResponse, + ) + from datadog_api_client.v2.model.synthetics_downtime_resource_type import SyntheticsDowntimeResourceType + + return { + "attributes": (SyntheticsDowntimeDataAttributesResponse,), + "id": (str,), + "type": (SyntheticsDowntimeResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: SyntheticsDowntimeDataAttributesResponse, + id: str, + type: SyntheticsDowntimeResourceType, + **kwargs, + ): + """ + A Synthetics downtime object. + + :param attributes: Attributes of a Synthetics downtime response object. + :type attributes: SyntheticsDowntimeDataAttributesResponse + + :param id: The unique identifier of the downtime. + :type id: str + + :param type: The resource type for a Synthetics downtime. + :type type: SyntheticsDowntimeResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/synthetics_downtime_data_attributes_request.py b/src/datadog_api_client/v2/model/synthetics_downtime_data_attributes_request.py new file mode 100644 index 0000000000..6b7f93b792 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_downtime_data_attributes_request.py @@ -0,0 +1,83 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_downtime_time_slot_request import SyntheticsDowntimeTimeSlotRequest + + +class SyntheticsDowntimeDataAttributesRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_downtime_time_slot_request import SyntheticsDowntimeTimeSlotRequest + + return { + "description": (str,), + "is_enabled": (bool,), + "name": (str,), + "tags": ([str],), + "test_ids": ([str],), + "time_slots": ([SyntheticsDowntimeTimeSlotRequest],), + } + + attribute_map = { + "description": "description", + "is_enabled": "isEnabled", + "name": "name", + "tags": "tags", + "test_ids": "testIds", + "time_slots": "timeSlots", + } + + def __init__( + self_, + is_enabled: bool, + name: str, + test_ids: List[str], + time_slots: List[SyntheticsDowntimeTimeSlotRequest], + description: Union[str, UnsetType] = unset, + tags: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Attributes for creating or updating a Synthetics downtime. + + :param description: An optional description of the downtime. + :type description: str, optional + + :param is_enabled: Whether the downtime is enabled. + :type is_enabled: bool + + :param name: The name of the downtime. + :type name: str + + :param tags: List of tags associated with a Synthetics downtime. + :type tags: [str], optional + + :param test_ids: List of Synthetics test public IDs associated with a downtime. + :type test_ids: [str] + + :param time_slots: List of time slots for a Synthetics downtime create or update request. + :type time_slots: [SyntheticsDowntimeTimeSlotRequest] + """ + if description is not unset: + kwargs["description"] = description + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) + + self_.is_enabled = is_enabled + self_.name = name + self_.test_ids = test_ids + self_.time_slots = time_slots diff --git a/src/datadog_api_client/v2/model/synthetics_downtime_data_attributes_response.py b/src/datadog_api_client/v2/model/synthetics_downtime_data_attributes_response.py new file mode 100644 index 0000000000..d26e0f18eb --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_downtime_data_attributes_response.py @@ -0,0 +1,124 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_downtime_time_slot_response import SyntheticsDowntimeTimeSlotResponse + + +class SyntheticsDowntimeDataAttributesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_downtime_time_slot_response import ( + SyntheticsDowntimeTimeSlotResponse, + ) + + return { + "created_at": (datetime,), + "created_by": (str,), + "created_by_name": (str,), + "description": (str,), + "is_enabled": (bool,), + "name": (str,), + "tags": ([str],), + "test_ids": ([str],), + "time_slots": ([SyntheticsDowntimeTimeSlotResponse],), + "updated_at": (datetime,), + "updated_by": (str,), + "updated_by_name": (str,), + } + + attribute_map = { + "created_at": "createdAt", + "created_by": "createdBy", + "created_by_name": "createdByName", + "description": "description", + "is_enabled": "isEnabled", + "name": "name", + "tags": "tags", + "test_ids": "testIds", + "time_slots": "timeSlots", + "updated_at": "updatedAt", + "updated_by": "updatedBy", + "updated_by_name": "updatedByName", + } + + def __init__( + self_, + created_at: datetime, + created_by: str, + created_by_name: str, + description: str, + is_enabled: bool, + name: str, + tags: List[str], + test_ids: List[str], + time_slots: List[SyntheticsDowntimeTimeSlotResponse], + updated_at: datetime, + updated_by: str, + updated_by_name: str, + **kwargs, + ): + """ + Attributes of a Synthetics downtime response object. + + :param created_at: The timestamp when the downtime was created. + :type created_at: datetime + + :param created_by: The UUID of the user who created the downtime. + :type created_by: str + + :param created_by_name: The display name of the user who created the downtime. + :type created_by_name: str + + :param description: The description of the downtime. + :type description: str + + :param is_enabled: Whether the downtime is enabled. + :type is_enabled: bool + + :param name: The name of the downtime. + :type name: str + + :param tags: List of tags associated with a Synthetics downtime. + :type tags: [str] + + :param test_ids: List of Synthetics test public IDs associated with a downtime. + :type test_ids: [str] + + :param time_slots: List of time slots in a Synthetics downtime response. + :type time_slots: [SyntheticsDowntimeTimeSlotResponse] + + :param updated_at: The timestamp when the downtime was last updated. + :type updated_at: datetime + + :param updated_by: The UUID of the user who last updated the downtime. + :type updated_by: str + + :param updated_by_name: The display name of the user who last updated the downtime. + :type updated_by_name: str + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.created_by = created_by + self_.created_by_name = created_by_name + self_.description = description + self_.is_enabled = is_enabled + self_.name = name + self_.tags = tags + self_.test_ids = test_ids + self_.time_slots = time_slots + self_.updated_at = updated_at + self_.updated_by = updated_by + self_.updated_by_name = updated_by_name diff --git a/src/datadog_api_client/v2/model/synthetics_downtime_data_request.py b/src/datadog_api_client/v2/model/synthetics_downtime_data_request.py new file mode 100644 index 0000000000..c94f61f13b --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_downtime_data_request.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_downtime_data_attributes_request import ( + SyntheticsDowntimeDataAttributesRequest, + ) + from datadog_api_client.v2.model.synthetics_downtime_resource_type import SyntheticsDowntimeResourceType + + +class SyntheticsDowntimeDataRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_downtime_data_attributes_request import ( + SyntheticsDowntimeDataAttributesRequest, + ) + from datadog_api_client.v2.model.synthetics_downtime_resource_type import SyntheticsDowntimeResourceType + + return { + "attributes": (SyntheticsDowntimeDataAttributesRequest,), + "type": (SyntheticsDowntimeResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, attributes: SyntheticsDowntimeDataAttributesRequest, type: SyntheticsDowntimeResourceType, **kwargs + ): + """ + The data object for a Synthetics downtime create or update request. + + :param attributes: Attributes for creating or updating a Synthetics downtime. + :type attributes: SyntheticsDowntimeDataAttributesRequest + + :param type: The resource type for a Synthetics downtime. + :type type: SyntheticsDowntimeResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/synthetics_downtime_frequency.py b/src/datadog_api_client/v2/model/synthetics_downtime_frequency.py new file mode 100644 index 0000000000..4382b26b62 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_downtime_frequency.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SyntheticsDowntimeFrequency(ModelSimple): + """ + The recurrence frequency of a Synthetics downtime time slot. + + :param value: Must be one of ["DAILY", "WEEKLY", "MONTHLY", "YEARLY"]. + :type value: str + """ + + allowed_values = { + "DAILY", + "WEEKLY", + "MONTHLY", + "YEARLY", + } + DAILY: ClassVar["SyntheticsDowntimeFrequency"] + WEEKLY: ClassVar["SyntheticsDowntimeFrequency"] + MONTHLY: ClassVar["SyntheticsDowntimeFrequency"] + YEARLY: ClassVar["SyntheticsDowntimeFrequency"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsDowntimeFrequency.DAILY = SyntheticsDowntimeFrequency("DAILY") +SyntheticsDowntimeFrequency.WEEKLY = SyntheticsDowntimeFrequency("WEEKLY") +SyntheticsDowntimeFrequency.MONTHLY = SyntheticsDowntimeFrequency("MONTHLY") +SyntheticsDowntimeFrequency.YEARLY = SyntheticsDowntimeFrequency("YEARLY") diff --git a/src/datadog_api_client/v2/model/synthetics_downtime_request.py b/src/datadog_api_client/v2/model/synthetics_downtime_request.py new file mode 100644 index 0000000000..54cb2caded --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_downtime_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_downtime_data_request import SyntheticsDowntimeDataRequest + + +class SyntheticsDowntimeRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_downtime_data_request import SyntheticsDowntimeDataRequest + + return { + "data": (SyntheticsDowntimeDataRequest,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: SyntheticsDowntimeDataRequest, **kwargs): + """ + Request body for creating or updating a Synthetics downtime. + + :param data: The data object for a Synthetics downtime create or update request. + :type data: SyntheticsDowntimeDataRequest + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/synthetics_downtime_resource_type.py b/src/datadog_api_client/v2/model/synthetics_downtime_resource_type.py new file mode 100644 index 0000000000..f9e2553940 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_downtime_resource_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SyntheticsDowntimeResourceType(ModelSimple): + """ + The resource type for a Synthetics downtime. + + :param value: If omitted defaults to "downtime". Must be one of ["downtime"]. + :type value: str + """ + + allowed_values = { + "downtime", + } + DOWNTIME: ClassVar["SyntheticsDowntimeResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsDowntimeResourceType.DOWNTIME = SyntheticsDowntimeResourceType("downtime") diff --git a/src/datadog_api_client/v2/model/synthetics_downtime_response.py b/src/datadog_api_client/v2/model/synthetics_downtime_response.py new file mode 100644 index 0000000000..9cb21270ee --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_downtime_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_downtime_data import SyntheticsDowntimeData + + +class SyntheticsDowntimeResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_downtime_data import SyntheticsDowntimeData + + return { + "data": (SyntheticsDowntimeData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: SyntheticsDowntimeData, **kwargs): + """ + Response containing a single Synthetics downtime. + + :param data: A Synthetics downtime object. + :type data: SyntheticsDowntimeData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/synthetics_downtime_time_slot_date.py b/src/datadog_api_client/v2/model/synthetics_downtime_time_slot_date.py new file mode 100644 index 0000000000..358eafabed --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_downtime_time_slot_date.py @@ -0,0 +1,57 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class SyntheticsDowntimeTimeSlotDate(ModelNormal): + @cached_property + def openapi_types(_): + return { + "day": (int,), + "hour": (int,), + "minute": (int,), + "month": (int,), + "year": (int,), + } + + attribute_map = { + "day": "day", + "hour": "hour", + "minute": "minute", + "month": "month", + "year": "year", + } + + def __init__(self_, day: int, hour: int, minute: int, month: int, year: int, **kwargs): + """ + A specific date and time used to define the start or end of a Synthetics downtime time slot. + + :param day: The day component of the date (1-31). + :type day: int + + :param hour: The hour component of the time (0-23). + :type hour: int + + :param minute: The minute component of the time (0-59). + :type minute: int + + :param month: The month component of the date (1-12). + :type month: int + + :param year: The year component of the date. + :type year: int + """ + super().__init__(kwargs) + + self_.day = day + self_.hour = hour + self_.minute = minute + self_.month = month + self_.year = year diff --git a/src/datadog_api_client/v2/model/synthetics_downtime_time_slot_recurrence_request.py b/src/datadog_api_client/v2/model/synthetics_downtime_time_slot_recurrence_request.py new file mode 100644 index 0000000000..b0e0ac51eb --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_downtime_time_slot_recurrence_request.py @@ -0,0 +1,74 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_downtime_time_slot_date import SyntheticsDowntimeTimeSlotDate + from datadog_api_client.v2.model.synthetics_downtime_frequency import SyntheticsDowntimeFrequency + from datadog_api_client.v2.model.synthetics_downtime_weekday import SyntheticsDowntimeWeekday + + +class SyntheticsDowntimeTimeSlotRecurrenceRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_downtime_time_slot_date import SyntheticsDowntimeTimeSlotDate + from datadog_api_client.v2.model.synthetics_downtime_frequency import SyntheticsDowntimeFrequency + from datadog_api_client.v2.model.synthetics_downtime_weekday import SyntheticsDowntimeWeekday + + return { + "end": (SyntheticsDowntimeTimeSlotDate,), + "frequency": (SyntheticsDowntimeFrequency,), + "interval": (int,), + "weekdays": ([SyntheticsDowntimeWeekday],), + } + + attribute_map = { + "end": "end", + "frequency": "frequency", + "interval": "interval", + "weekdays": "weekdays", + } + + def __init__( + self_, + frequency: SyntheticsDowntimeFrequency, + end: Union[SyntheticsDowntimeTimeSlotDate, UnsetType] = unset, + interval: Union[int, UnsetType] = unset, + weekdays: Union[List[SyntheticsDowntimeWeekday], UnsetType] = unset, + **kwargs, + ): + """ + Recurrence settings for a Synthetics downtime time slot. + + :param end: A specific date and time used to define the start or end of a Synthetics downtime time slot. + :type end: SyntheticsDowntimeTimeSlotDate, optional + + :param frequency: The recurrence frequency of a Synthetics downtime time slot. + :type frequency: SyntheticsDowntimeFrequency + + :param interval: The interval between recurrences, relative to the frequency. + :type interval: int, optional + + :param weekdays: Days of the week for a Synthetics downtime recurrence schedule. + :type weekdays: [SyntheticsDowntimeWeekday], optional + """ + if end is not unset: + kwargs["end"] = end + if interval is not unset: + kwargs["interval"] = interval + if weekdays is not unset: + kwargs["weekdays"] = weekdays + super().__init__(kwargs) + + self_.frequency = frequency diff --git a/src/datadog_api_client/v2/model/synthetics_downtime_time_slot_recurrence_response.py b/src/datadog_api_client/v2/model/synthetics_downtime_time_slot_recurrence_response.py new file mode 100644 index 0000000000..a4b9bc3751 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_downtime_time_slot_recurrence_response.py @@ -0,0 +1,72 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_downtime_frequency import SyntheticsDowntimeFrequency + from datadog_api_client.v2.model.synthetics_downtime_time_slot_date import SyntheticsDowntimeTimeSlotDate + from datadog_api_client.v2.model.synthetics_downtime_weekday import SyntheticsDowntimeWeekday + + +class SyntheticsDowntimeTimeSlotRecurrenceResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_downtime_frequency import SyntheticsDowntimeFrequency + from datadog_api_client.v2.model.synthetics_downtime_time_slot_date import SyntheticsDowntimeTimeSlotDate + from datadog_api_client.v2.model.synthetics_downtime_weekday import SyntheticsDowntimeWeekday + + return { + "frequency": (SyntheticsDowntimeFrequency,), + "interval": (int,), + "until": (SyntheticsDowntimeTimeSlotDate,), + "weekdays": ([SyntheticsDowntimeWeekday],), + } + + attribute_map = { + "frequency": "frequency", + "interval": "interval", + "until": "until", + "weekdays": "weekdays", + } + + def __init__( + self_, + frequency: SyntheticsDowntimeFrequency, + interval: int, + weekdays: List[SyntheticsDowntimeWeekday], + until: Union[SyntheticsDowntimeTimeSlotDate, UnsetType] = unset, + **kwargs, + ): + """ + Recurrence settings returned in a Synthetics downtime time slot response. + + :param frequency: The recurrence frequency of a Synthetics downtime time slot. + :type frequency: SyntheticsDowntimeFrequency + + :param interval: The interval between recurrences, relative to the frequency. + :type interval: int + + :param until: A specific date and time used to define the start or end of a Synthetics downtime time slot. + :type until: SyntheticsDowntimeTimeSlotDate, optional + + :param weekdays: Days of the week for a Synthetics downtime recurrence schedule. + :type weekdays: [SyntheticsDowntimeWeekday] + """ + if until is not unset: + kwargs["until"] = until + super().__init__(kwargs) + + self_.frequency = frequency + self_.interval = interval + self_.weekdays = weekdays diff --git a/src/datadog_api_client/v2/model/synthetics_downtime_time_slot_request.py b/src/datadog_api_client/v2/model/synthetics_downtime_time_slot_request.py new file mode 100644 index 0000000000..fa537ba4a7 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_downtime_time_slot_request.py @@ -0,0 +1,82 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_downtime_time_slot_recurrence_request import ( + SyntheticsDowntimeTimeSlotRecurrenceRequest, + ) + from datadog_api_client.v2.model.synthetics_downtime_time_slot_date import SyntheticsDowntimeTimeSlotDate + + +class SyntheticsDowntimeTimeSlotRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_downtime_time_slot_recurrence_request import ( + SyntheticsDowntimeTimeSlotRecurrenceRequest, + ) + from datadog_api_client.v2.model.synthetics_downtime_time_slot_date import SyntheticsDowntimeTimeSlotDate + + return { + "duration": (int,), + "name": (str,), + "recurrence": (SyntheticsDowntimeTimeSlotRecurrenceRequest,), + "start": (SyntheticsDowntimeTimeSlotDate,), + "timezone": (str,), + } + + attribute_map = { + "duration": "duration", + "name": "name", + "recurrence": "recurrence", + "start": "start", + "timezone": "timezone", + } + + def __init__( + self_, + duration: int, + start: SyntheticsDowntimeTimeSlotDate, + timezone: str, + name: Union[str, UnsetType] = unset, + recurrence: Union[SyntheticsDowntimeTimeSlotRecurrenceRequest, UnsetType] = unset, + **kwargs, + ): + """ + A time slot for a Synthetics downtime create or update request. + + :param duration: The duration of the time slot in seconds, between 60 and 604800. + :type duration: int + + :param name: An optional label for the time slot. + :type name: str, optional + + :param recurrence: Recurrence settings for a Synthetics downtime time slot. + :type recurrence: SyntheticsDowntimeTimeSlotRecurrenceRequest, optional + + :param start: A specific date and time used to define the start or end of a Synthetics downtime time slot. + :type start: SyntheticsDowntimeTimeSlotDate + + :param timezone: The IANA timezone name for the time slot. + :type timezone: str + """ + if name is not unset: + kwargs["name"] = name + if recurrence is not unset: + kwargs["recurrence"] = recurrence + super().__init__(kwargs) + + self_.duration = duration + self_.start = start + self_.timezone = timezone diff --git a/src/datadog_api_client/v2/model/synthetics_downtime_time_slot_response.py b/src/datadog_api_client/v2/model/synthetics_downtime_time_slot_response.py new file mode 100644 index 0000000000..8e881b9cea --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_downtime_time_slot_response.py @@ -0,0 +1,89 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_downtime_time_slot_recurrence_response import ( + SyntheticsDowntimeTimeSlotRecurrenceResponse, + ) + from datadog_api_client.v2.model.synthetics_downtime_time_slot_date import SyntheticsDowntimeTimeSlotDate + + +class SyntheticsDowntimeTimeSlotResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_downtime_time_slot_recurrence_response import ( + SyntheticsDowntimeTimeSlotRecurrenceResponse, + ) + from datadog_api_client.v2.model.synthetics_downtime_time_slot_date import SyntheticsDowntimeTimeSlotDate + + return { + "duration": (int,), + "id": (str,), + "name": (str,), + "recurrence": (SyntheticsDowntimeTimeSlotRecurrenceResponse,), + "start": (SyntheticsDowntimeTimeSlotDate,), + "timezone": (str,), + } + + attribute_map = { + "duration": "duration", + "id": "id", + "name": "name", + "recurrence": "recurrence", + "start": "start", + "timezone": "timezone", + } + + def __init__( + self_, + duration: int, + id: str, + start: SyntheticsDowntimeTimeSlotDate, + timezone: str, + name: Union[str, UnsetType] = unset, + recurrence: Union[SyntheticsDowntimeTimeSlotRecurrenceResponse, UnsetType] = unset, + **kwargs, + ): + """ + A time slot returned in a Synthetics downtime response. + + :param duration: The duration of the time slot in seconds. + :type duration: int + + :param id: The unique identifier of the time slot. + :type id: str + + :param name: The label for the time slot. + :type name: str, optional + + :param recurrence: Recurrence settings returned in a Synthetics downtime time slot response. + :type recurrence: SyntheticsDowntimeTimeSlotRecurrenceResponse, optional + + :param start: A specific date and time used to define the start or end of a Synthetics downtime time slot. + :type start: SyntheticsDowntimeTimeSlotDate + + :param timezone: The IANA timezone name for the time slot. + :type timezone: str + """ + if name is not unset: + kwargs["name"] = name + if recurrence is not unset: + kwargs["recurrence"] = recurrence + super().__init__(kwargs) + + self_.duration = duration + self_.id = id + self_.start = start + self_.timezone = timezone diff --git a/src/datadog_api_client/v2/model/synthetics_downtime_weekday.py b/src/datadog_api_client/v2/model/synthetics_downtime_weekday.py new file mode 100644 index 0000000000..44f0860a08 --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_downtime_weekday.py @@ -0,0 +1,53 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class SyntheticsDowntimeWeekday(ModelSimple): + """ + A day of the week for a Synthetics downtime recurrence. + + :param value: Must be one of ["MO", "TU", "WE", "TH", "FR", "SA", "SU"]. + :type value: str + """ + + allowed_values = { + "MO", + "TU", + "WE", + "TH", + "FR", + "SA", + "SU", + } + MONDAY: ClassVar["SyntheticsDowntimeWeekday"] + TUESDAY: ClassVar["SyntheticsDowntimeWeekday"] + WEDNESDAY: ClassVar["SyntheticsDowntimeWeekday"] + THURSDAY: ClassVar["SyntheticsDowntimeWeekday"] + FRIDAY: ClassVar["SyntheticsDowntimeWeekday"] + SATURDAY: ClassVar["SyntheticsDowntimeWeekday"] + SUNDAY: ClassVar["SyntheticsDowntimeWeekday"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SyntheticsDowntimeWeekday.MONDAY = SyntheticsDowntimeWeekday("MO") +SyntheticsDowntimeWeekday.TUESDAY = SyntheticsDowntimeWeekday("TU") +SyntheticsDowntimeWeekday.WEDNESDAY = SyntheticsDowntimeWeekday("WE") +SyntheticsDowntimeWeekday.THURSDAY = SyntheticsDowntimeWeekday("TH") +SyntheticsDowntimeWeekday.FRIDAY = SyntheticsDowntimeWeekday("FR") +SyntheticsDowntimeWeekday.SATURDAY = SyntheticsDowntimeWeekday("SA") +SyntheticsDowntimeWeekday.SUNDAY = SyntheticsDowntimeWeekday("SU") diff --git a/src/datadog_api_client/v2/model/synthetics_downtimes_response.py b/src/datadog_api_client/v2/model/synthetics_downtimes_response.py new file mode 100644 index 0000000000..2e623eae1f --- /dev/null +++ b/src/datadog_api_client/v2/model/synthetics_downtimes_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.synthetics_downtime_data import SyntheticsDowntimeData + + +class SyntheticsDowntimesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.synthetics_downtime_data import SyntheticsDowntimeData + + return { + "data": ([SyntheticsDowntimeData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[SyntheticsDowntimeData], **kwargs): + """ + Response containing a list of Synthetics downtimes. + + :param data: List of Synthetics downtime objects. + :type data: [SyntheticsDowntimeData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 2eb9447a65..853ba10fde 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -6503,6 +6503,29 @@ from datadog_api_client.v2.model.synthetics_api_multistep_subtests_response import ( SyntheticsApiMultistepSubtestsResponse, ) +from datadog_api_client.v2.model.synthetics_downtime_data import SyntheticsDowntimeData +from datadog_api_client.v2.model.synthetics_downtime_data_attributes_request import ( + SyntheticsDowntimeDataAttributesRequest, +) +from datadog_api_client.v2.model.synthetics_downtime_data_attributes_response import ( + SyntheticsDowntimeDataAttributesResponse, +) +from datadog_api_client.v2.model.synthetics_downtime_data_request import SyntheticsDowntimeDataRequest +from datadog_api_client.v2.model.synthetics_downtime_frequency import SyntheticsDowntimeFrequency +from datadog_api_client.v2.model.synthetics_downtime_request import SyntheticsDowntimeRequest +from datadog_api_client.v2.model.synthetics_downtime_resource_type import SyntheticsDowntimeResourceType +from datadog_api_client.v2.model.synthetics_downtime_response import SyntheticsDowntimeResponse +from datadog_api_client.v2.model.synthetics_downtime_time_slot_date import SyntheticsDowntimeTimeSlotDate +from datadog_api_client.v2.model.synthetics_downtime_time_slot_recurrence_request import ( + SyntheticsDowntimeTimeSlotRecurrenceRequest, +) +from datadog_api_client.v2.model.synthetics_downtime_time_slot_recurrence_response import ( + SyntheticsDowntimeTimeSlotRecurrenceResponse, +) +from datadog_api_client.v2.model.synthetics_downtime_time_slot_request import SyntheticsDowntimeTimeSlotRequest +from datadog_api_client.v2.model.synthetics_downtime_time_slot_response import SyntheticsDowntimeTimeSlotResponse +from datadog_api_client.v2.model.synthetics_downtime_weekday import SyntheticsDowntimeWeekday +from datadog_api_client.v2.model.synthetics_downtimes_response import SyntheticsDowntimesResponse from datadog_api_client.v2.model.synthetics_fast_test_result import SyntheticsFastTestResult from datadog_api_client.v2.model.synthetics_fast_test_result_attributes import SyntheticsFastTestResultAttributes from datadog_api_client.v2.model.synthetics_fast_test_result_data import SyntheticsFastTestResultData @@ -11946,6 +11969,21 @@ "SyntheticsApiMultistepSubtestData", "SyntheticsApiMultistepSubtestType", "SyntheticsApiMultistepSubtestsResponse", + "SyntheticsDowntimeData", + "SyntheticsDowntimeDataAttributesRequest", + "SyntheticsDowntimeDataAttributesResponse", + "SyntheticsDowntimeDataRequest", + "SyntheticsDowntimeFrequency", + "SyntheticsDowntimeRequest", + "SyntheticsDowntimeResourceType", + "SyntheticsDowntimeResponse", + "SyntheticsDowntimeTimeSlotDate", + "SyntheticsDowntimeTimeSlotRecurrenceRequest", + "SyntheticsDowntimeTimeSlotRecurrenceResponse", + "SyntheticsDowntimeTimeSlotRequest", + "SyntheticsDowntimeTimeSlotResponse", + "SyntheticsDowntimeWeekday", + "SyntheticsDowntimesResponse", "SyntheticsFastTestResult", "SyntheticsFastTestResultAttributes", "SyntheticsFastTestResultData", diff --git a/tests/v2/features/synthetics.feature b/tests/v2/features/synthetics.feature index f847bc0e70..f43e2e2c99 100644 --- a/tests/v2/features/synthetics.feature +++ b/tests/v2/features/synthetics.feature @@ -33,6 +33,30 @@ Feature: Synthetics When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Add a test to a Synthetics downtime returns "Bad Request" response + Given new "AddTestToSyntheticsDowntime" request + And request contains "downtime_id" parameter from "REPLACE.ME" + And request contains "test_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Add a test to a Synthetics downtime returns "Not Found" response + Given new "AddTestToSyntheticsDowntime" request + And request contains "downtime_id" parameter from "REPLACE.ME" + And request contains "test_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Add a test to a Synthetics downtime returns "OK" response + Given new "AddTestToSyntheticsDowntime" request + And request contains "downtime_id" parameter from "REPLACE.ME" + And request contains "test_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-orchestrating-managing Scenario: Bulk delete suites returns "API error response." response Given new "DeleteSyntheticsSuites" request @@ -91,6 +115,20 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Create a Synthetics downtime returns "Bad Request" response + Given new "CreateSyntheticsDowntime" request + And body with value {"data": {"attributes": {"isEnabled": true, "name": "Weekly maintenance", "testIds": ["abc-def-123"], "timeSlots": [{"duration": 3600, "start": {"day": 15, "hour": 10, "minute": 30, "month": 1, "year": 2024}, "timezone": "Europe/Paris"}]}, "type": "downtime"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Create a Synthetics downtime returns "Created" response + Given new "CreateSyntheticsDowntime" request + And body with value {"data": {"attributes": {"isEnabled": true, "name": "Weekly maintenance", "testIds": ["abc-def-123"], "timeSlots": [{"duration": 3600, "start": {"day": 15, "hour": 10, "minute": 30, "month": 1, "year": 2024}, "timezone": "Europe/Paris"}]}, "type": "downtime"}} + When the request is sent + Then the response status is 201 Created + @generated @skip @team:DataDog/synthetics-orchestrating-managing Scenario: Create a test suite returns "API error response." response Given new "CreateSyntheticsSuite" request @@ -105,6 +143,27 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Delete a Synthetics downtime returns "Bad Request" response + Given new "DeleteSyntheticsDowntime" request + And request contains "downtime_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Delete a Synthetics downtime returns "No Content" response + Given new "DeleteSyntheticsDowntime" request + And request contains "downtime_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Delete a Synthetics downtime returns "Not Found" response + Given new "DeleteSyntheticsDowntime" request + And request contains "downtime_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/synthetics-orchestrating-managing Scenario: Edit a Network Path test returns "API error response." response Given new "UpdateSyntheticsNetworkTest" request @@ -151,6 +210,27 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Get a Synthetics downtime returns "Bad Request" response + Given new "GetSyntheticsDowntime" request + And request contains "downtime_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Get a Synthetics downtime returns "Not Found" response + Given new "GetSyntheticsDowntime" request + And request contains "downtime_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Get a Synthetics downtime returns "OK" response + Given new "GetSyntheticsDowntime" request + And request contains "downtime_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-orchestrating-managing Scenario: Get a browser test result returns "API error response." response Given new "GetSyntheticsBrowserTestResult" request @@ -342,6 +422,18 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: List Synthetics downtimes returns "Bad Request" response + Given new "ListSyntheticsDowntimes" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: List Synthetics downtimes returns "OK" response + Given new "ListSyntheticsDowntimes" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-orchestrating-managing Scenario: Patch a global variable returns "Bad Request" response Given new "PatchGlobalVariable" request @@ -396,6 +488,30 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Remove a test from a Synthetics downtime returns "Bad Request" response + Given new "RemoveTestFromSyntheticsDowntime" request + And request contains "downtime_id" parameter from "REPLACE.ME" + And request contains "test_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Remove a test from a Synthetics downtime returns "Not Found" response + Given new "RemoveTestFromSyntheticsDowntime" request + And request contains "downtime_id" parameter from "REPLACE.ME" + And request contains "test_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Remove a test from a Synthetics downtime returns "OK" response + Given new "RemoveTestFromSyntheticsDowntime" request + And request contains "downtime_id" parameter from "REPLACE.ME" + And request contains "test_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/synthetics-orchestrating-managing Scenario: Save new value for on-demand concurrency cap returns "OK" response Given new "SetOnDemandConcurrencyCap" request @@ -421,3 +537,27 @@ Feature: Synthetics Given new "SearchSuites" request When the request is sent Then the response status is 200 OK + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Update a Synthetics downtime returns "Bad Request" response + Given new "UpdateSyntheticsDowntime" request + And request contains "downtime_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"isEnabled": true, "name": "Weekly maintenance", "testIds": ["abc-def-123"], "timeSlots": [{"duration": 3600, "start": {"day": 15, "hour": 10, "minute": 30, "month": 1, "year": 2024}, "timezone": "Europe/Paris"}]}, "type": "downtime"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Update a Synthetics downtime returns "Not Found" response + Given new "UpdateSyntheticsDowntime" request + And request contains "downtime_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"isEnabled": true, "name": "Weekly maintenance", "testIds": ["abc-def-123"], "timeSlots": [{"duration": 3600, "start": {"day": 15, "hour": 10, "minute": 30, "month": 1, "year": 2024}, "timezone": "Europe/Paris"}]}, "type": "downtime"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Update a Synthetics downtime returns "OK" response + Given new "UpdateSyntheticsDowntime" request + And request contains "downtime_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"isEnabled": true, "name": "Weekly maintenance", "testIds": ["abc-def-123"], "timeSlots": [{"duration": 3600, "start": {"day": 15, "hour": 10, "minute": 30, "month": 1, "year": 2024}, "timezone": "Europe/Paris"}]}, "type": "downtime"}} + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 71b0e9ba7a..749a957a8f 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -6404,6 +6404,69 @@ "type": "safe" } }, + "ListSyntheticsDowntimes": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "CreateSyntheticsDowntime": { + "tag": "Synthetics", + "undo": { + "operationId": "DeleteSyntheticsDowntime", + "parameters": [ + { + "name": "downtime_id", + "origin": "path", + "source": "downtime_id" + } + ], + "type": "unsafe" + } + }, + "DeleteSyntheticsDowntime": { + "tag": "Synthetics", + "undo": { + "type": "idempotent" + } + }, + "GetSyntheticsDowntime": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "UpdateSyntheticsDowntime": { + "tag": "Synthetics", + "undo": { + "type": "unsafe" + } + }, + "RemoveTestFromSyntheticsDowntime": { + "tag": "Synthetics", + "undo": { + "type": "idempotent" + } + }, + "AddTestToSyntheticsDowntime": { + "tag": "Synthetics", + "undo": { + "operationId": "RemoveTestFromSyntheticsDowntime", + "parameters": [ + { + "name": "downtime_id", + "origin": "path", + "source": "downtime_id" + }, + { + "name": "test_id", + "origin": "path", + "source": "test_id" + } + ], + "type": "unsafe" + } + }, "GetOnDemandConcurrencyCap": { "tag": "Synthetics", "undo": {