diff --git a/.apigentools-info b/.apigentools-info index ecdc1d27ea..e9b2ae56c2 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-13 07:28:00.920852", - "spec_repo_commit": "82fabb35" + "regenerated": "2022-09-13 18:39:22.680966", + "spec_repo_commit": "f51fafff" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-13 07:28:00.933515", - "spec_repo_commit": "82fabb35" + "regenerated": "2022-09-13 18:39:22.695724", + "spec_repo_commit": "f51fafff" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 3b423d98db..d05b721d69 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -8696,20 +8696,6 @@ components: example: UTC type: string type: object - SLOCreator: - description: The creator of the SLO - nullable: true - properties: - email: - description: Email of the creator. - type: string - id: - description: User ID of the creator. - type: string - name: - description: Name of the creator. - type: string - type: object SLODeleteResponse: description: A response list of all service level objective deleted. properties: @@ -9220,55 +9206,6 @@ components: format: int64 type: integer type: object - SLOOverallStatuses: - description: Overall status of the SLO by timeframes. - properties: - error: - description: Error message if SLO status or error budget could not be calculated. - nullable: true - type: string - indexed_at: - description: 'timestamp (UNIX time in seconds) of when the SLO status and - error budget - - were calculated.' - example: 1662496260 - format: int64 - type: integer - raw_error_budget_remaining: - $ref: '#/components/schemas/SLORawErrorBudgetRemaining' - span_precision: - description: The amount of decimal places the SLI value is accurate to. - example: 2 - format: int64 - type: integer - status: - description: The status of the SLO. - example: 100 - format: double - nullable: true - type: number - target: - description: The target of the SLO. - example: 99 - format: double - type: number - timeframe: - $ref: '#/components/schemas/SLOTimeframe' - type: object - SLORawErrorBudgetRemaining: - description: Error budget remaining for an SLO. - properties: - unit: - description: Error budget remaining unit. - example: requests - type: string - value: - description: Error budget remaining value. - example: 60 - format: double - type: number - type: object SLOResponse: description: A service level objective response containing a single service level objective. @@ -9706,38 +9643,6 @@ components: - formula - dimension type: object - SearchSLOQuery: - description: 'A metric-based SLO. **Required if type is `metric`**. Note that - Datadog only allows the sum by aggregator - - to be used because this will sum up all request counts instead of averaging - them, or taking the max or - - min of all of those requests.' - nullable: true - properties: - denominator: - description: A Datadog metric query for total (valid) events. - example: sum:my.custom.metric{*}.as_count() - type: string - metrics: - description: 'Metric names used in the query''s numerator and denominator. - - This field will return null and will be implemented in the next version - of this endpoint.' - example: - - my.custom.metric - - my.other.custom.metric - items: - description: Metric name. - type: string - nullable: true - type: array - numerator: - description: A Datadog metric query for good events. - example: sum:my.custom.metric{type:good}.as_count() - type: string - type: object SearchSLOResponse: description: A search SLO response containing results from the search query. properties: @@ -9766,7 +9671,7 @@ components: slo: description: SLOs items: - $ref: '#/components/schemas/SearchServiceLevelObjective' + $ref: '#/components/schemas/ServiceLevelObjective' type: array type: object SearchSLOResponseDataAttributesFacets: @@ -9896,181 +9801,6 @@ components: description: Type of pagination. type: string type: object - SearchSLOThreshold: - description: SLO thresholds (target and optionally warning) for a single time - window. - properties: - target: - description: 'The target value for the service level indicator within the - corresponding - - timeframe.' - example: 99.9 - format: double - type: number - target_display: - description: 'A string representation of the target that indicates its precision. - - It uses trailing zeros to show significant decimal places (for example - `98.00`). - - - Always included in service level objective responses. Ignored in - - create/update requests.' - example: '99.9' - type: string - timeframe: - $ref: '#/components/schemas/SearchSLOTimeframe' - warning: - description: The warning value for the service level objective. - example: 90.0 - format: double - nullable: true - type: number - warning_display: - description: 'A string representation of the warning target (see the description - of - - the `target_display` field for details). - - - Included in service level objective responses if a warning target exists. - - Ignored in create/update requests.' - example: '90.0' - nullable: true - type: string - required: - - timeframe - - target - type: object - SearchSLOTimeframe: - description: The SLO time window options. - enum: - - 7d - - 30d - - 90d - example: 30d - type: string - x-enum-varnames: - - SEVEN_DAYS - - THIRTY_DAYS - - NINETY_DAYS - SearchServiceLevelObjective: - description: 'A service level objective object includes a service level indicator, - thresholds - - for one or more timeframes, and metadata (`name`, `description`, `tags`, etc.).' - properties: - all_tags: - description: 'A list of tags associated with this service level objective. - - Always included in service level objective responses (but may be empty). - - Optional in create/update requests.' - example: - - env:prod - - app:core - items: - description: A tag to apply to your SLO. - type: string - type: array - created_at: - description: 'Creation timestamp (UNIX time in seconds) - - - Always included in service level objective responses.' - format: int64 - readOnly: true - type: integer - creator: - $ref: '#/components/schemas/SLOCreator' - description: - description: 'A user-defined description of the service level objective. - - - Always included in service level objective responses (but may be `null`). - - Optional in create/update requests.' - nullable: true - type: string - groups: - description: 'A list of (up to 100) monitor groups that narrow the scope - of a monitor service level objective. - - - Included in service level objective responses if it is not empty. Optional - in - - create/update requests for monitor service level objectives, but may only - be - - used when then length of the `monitor_ids` field is one.' - example: - - env:prod - - role:mysql - items: - description: A group name, for instance `env:prod`. - type: string - nullable: true - type: array - id: - description: 'A unique identifier for the service level objective object. - - - Always included in service level objective responses.' - readOnly: true - type: string - modified_at: - description: 'Modification timestamp (UNIX time in seconds) - - - Always included in service level objective responses.' - format: int64 - readOnly: true - type: integer - monitor_ids: - description: 'A list of monitor ids that defines the scope of a monitor - service level - - objective. **Required if type is `monitor`**.' - items: - description: A monitor ID. - format: int64 - type: integer - nullable: true - type: array - name: - description: The name of the service level objective object. - example: Custom Metric SLO - type: string - overall_status: - description: calculated status and error budget remaining. - items: - $ref: '#/components/schemas/SLOOverallStatuses' - type: array - query: - $ref: '#/components/schemas/SearchSLOQuery' - thresholds: - description: 'The thresholds (timeframes and associated targets) for this - service level - - objective object.' - example: - - target: 95 - target_display: '95' - timeframe: 7d - - target: 95 - target_display: '95' - timeframe: 30d - warning: 97 - warning_display: '97' - items: - $ref: '#/components/schemas/SearchSLOThreshold' - type: array - type: - $ref: '#/components/schemas/SLOType' Series: description: 'A metric to submit to Datadog. @@ -24648,11 +24378,7 @@ paths: description: Get a list of service level objective objects for your organization. operationId: SearchSLO parameters: - - description: 'The query string to filter results based on SLO names. - - Some examples of queries include `service:` - - and ``.' + - description: The query string to filter results based on SLO names. in: query name: query required: false @@ -24673,12 +24399,6 @@ paths: schema: format: int64 type: integer - - description: Whether or not to return facet information in the response `[default=false]`. - in: query - name: include_facets - required: false - schema: - type: boolean responses: '200': content: @@ -24708,7 +24428,6 @@ paths: description: The regional site for Datadog customers. enum: - datadoghq.com - - datadoghq.eu - us3.datadoghq.com - us5.datadoghq.com - ddog-gov.com @@ -24734,7 +24453,9 @@ paths: summary: Search for SLOs tags: - Service Level Objectives - x-unstable: '**Note**: This endpoint is in public beta. + x-unstable: '**Note**: Note: This endpoint is in public beta for US regions. + + It is not currently supported in the EU region. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v1/slo/{slo_id}: diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ef1c74ffe4..ae0c97678c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -501,6 +501,135 @@ components: type: string x-enum-varnames: - API_KEYS + AccountConfig: + description: An API key and API secret pair that represents a Confluent account. + properties: + attributes: + $ref: '#/components/schemas/AccountConfigAttributes' + id: + description: A randomly generated ID associated with a Confluent account. + example: account_id_abc123 + type: string + type: + $ref: '#/components/schemas/AccountConfigType' + required: + - attributes + - id + - type + type: object + AccountConfigAttributes: + description: The attributes of a Confluent account. + properties: + api_key: + description: The API key associated with your Confluent account. + example: TESTAPIKEY123 + type: string + api_secret: + description: The API secret associated with your Confluent account. + example: test-api-secret-123 + type: string + writeOnly: true + resources: + description: A list of Confluent resources associated with the Confluent + account. + items: + $ref: '#/components/schemas/ConfluentCloudResource' + type: array + tags: + description: A comma-delimited string representation of tags. Can be a single + key, or key-value pairs separated by a colon. + example: + - myTag + - myTag2:myValue + items: + type: string + type: array + required: + - api_key + - api_secret + type: object + AccountConfigResponse: + description: The expected response schema when getting a Confluent account. + properties: + data: + $ref: '#/components/schemas/AccountConfig' + type: object + AccountConfigType: + default: confluent-cloud-accounts + description: The JSON:API type for this API. Should always be `confluent-cloud-accounts`. + enum: + - confluent-cloud-accounts + example: confluent-cloud-accounts + type: string + x-enum-varnames: + - CONFLUENT_CLOUD_ACCOUNTS + AccountConfigsResponse: + description: Confluent account returned by the API. + properties: + data: + description: The Confluent account. + items: + $ref: '#/components/schemas/AccountConfig' + type: array + type: object + AddAccount: + description: The data body for adding a Confluent account. + properties: + attributes: + $ref: '#/components/schemas/AddAccountAttributes' + type: + $ref: '#/components/schemas/AddAccountType' + required: + - attributes + - type + type: object + AddAccountAttributes: + description: Attributes associated with the account creation request. + properties: + api_key: + description: The API key associated with your Confluent account. + example: TESTAPIKEY123 + type: string + api_secret: + description: The API secret associated with your Confluent account. + example: test-api-secret-123 + type: string + resources: + description: A list of Confluent resources associated with the Confluent + account. + items: + $ref: '#/components/schemas/ConfluentCloudResource' + type: array + tags: + description: A comma-delimited string representation of tags. Can be a single + key, or key-value pairs separated by a colon. + example: + - myTag + - myTag2:myValue + items: + type: string + type: array + required: + - api_key + - api_secret + type: object + AddAccountRequest: + description: Payload schema when adding a Confluent account. + properties: + data: + $ref: '#/components/schemas/AddAccount' + required: + - data + type: object + AddAccountType: + default: confluent-cloud-accounts + description: The JSON:API type. Will always be `confluent-cloud-accounts`. + enum: + - confluent-cloud-accounts + example: confluent-cloud-accounts + type: string + x-enum-varnames: + - CONFLUENT_CLOUD_ACCOUNTS ApplicationKeyCreateAttributes: description: Attributes used to create an application Key. properties: @@ -1267,6 +1396,54 @@ components: $ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleData' type: array type: object + ConfluentCloudResource: + description: Model representation of a Confluent Cloud resource. + properties: + id: + description: The ID associated with the Confluent resource. + example: resource_id_abc123 + type: string + resource_type: + description: The resource type of the Resource. Can be `kafka`, `connector`, + `ksql`, or `schema_registry`. + example: kafka + type: string + tags: + description: A comma-delimited string representation of tags. Can be a single + key, or key-value pairs separated by a colon. + example: + - myTag + - myTag2:myValue + items: + type: string + type: array + required: + - id + - resource_type + type: object + ConfluentCloudResourceRequest: + description: Payload schema when interacting with a Confluent resource. + properties: + data: + $ref: '#/components/schemas/ConfluentCloudResource' + required: + - data + type: object + ConfluentCloudResourceResponse: + description: Response schema when interacting with a Confluent resource. + properties: + data: + $ref: '#/components/schemas/ConfluentCloudResource' + type: object + ConfluentCloudResourcesResponse: + description: Response schema when interacting with a list of Confluent resources. + properties: + data: + description: The JSON:API data attribute. + items: + $ref: '#/components/schemas/ConfluentCloudResource' + type: array + type: object ContentEncoding: description: HTTP header used to compress the media-type. enum: @@ -7909,6 +8086,108 @@ components: required: - data type: object + UpdateAccount: + description: Data object for updating a Confluent account. + properties: + attributes: + $ref: '#/components/schemas/UpdateAccountAttributes' + type: + $ref: '#/components/schemas/UpdateAccountType' + required: + - attributes + - type + type: object + UpdateAccountAttributes: + description: Attributes object for updating a Confluent account. + properties: + api_key: + description: The API key associated with your Confluent account. + example: TESTAPIKEY123 + type: string + api_secret: + description: The API secret associated with your Confluent account. + example: test-api-secret-123 + type: string + tags: + description: A comma-delimited string representation of tags. Can be a single + key, or key-value pairs separated by a colon. + example: + - myTag + - myTag2:myValue + items: + type: string + type: array + required: + - api_key + - api_secret + type: object + UpdateAccountRequest: + description: The JSON:API request for updating a Confluent account. + properties: + data: + $ref: '#/components/schemas/UpdateAccount' + required: + - data + type: object + UpdateAccountType: + default: confluent-cloud-accounts + description: The JSON:API type for this request. + enum: + - confluent-cloud-accounts + example: confluent-cloud-accounts + type: string + x-enum-varnames: + - CONFLUENT_CLOUD_ACCOUNTS + UpdateResource: + description: JSON:API request for updating a Confluent resource. + properties: + attributes: + $ref: '#/components/schemas/UpdateResourceAttributes' + id: + description: The ID associated with a Confluent resource. + example: resource-id-123 + type: string + type: + $ref: '#/components/schemas/UpdateResourceType' + required: + - id + - type + type: object + UpdateResourceAttributes: + description: Attributes object for updating a Confluent resource. + properties: + resource_type: + description: The resource type of the Resource. Can be `kafka`, `connector`, + `ksql`, or `schema_registry`. + example: kafka + type: string + tags: + description: A comma-delimited string representation of tags. Can be a single + key, or key-value pairs separated by a colon. + example: + - myTag + - myTag2:myValue + items: + type: string + type: array + type: object + UpdateResourceRequest: + description: The JSON:API request for updating a Confluent resource. + properties: + data: + $ref: '#/components/schemas/UpdateResource' + required: + - data + type: object + UpdateResourceType: + default: confluent-cloud-resources + description: The JSON:API type for this request. + enum: + - confluent-cloud-resources + example: confluent-cloud-resources + type: string + x-enum-varnames: + - CONFLUENT_CLOUD_RESOURCES UsageApplicationSecurityMonitoringResponse: description: Application Security Monitoring usage response. properties: @@ -9761,6 +10040,649 @@ paths: tags: - Opsgenie Integration x-codegen-request-body-name: body + /api/v2/integrations/confluent-cloud/accounts: + get: + description: Get a Confluent account with the provided account id. + operationId: ConfluentCloudPublic1 + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AccountConfigsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List Confluent accounts + tags: + - Confluent Cloud Accounts API + x-dd-ownership: + notification_configuration: + manual_escalation_policy: '[production][team][web-integrations]' + prod_high_urgency: '@pagerduty-web-integrations-high-urgency @slack-web-integrations-ops' + prod_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + slack_support_channel: '#web-integrations' + staging_high_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + staging_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + team: web-integrations + team_escalation: '[production][team][web-integrations]' + x-permission: + operator: OR + permissions: + - STANDARD + post: + description: Create a Confluent account. + operationId: ConfluentCloudPublic3 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AddAccountRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/AccountConfigResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Add Confluent account + tags: + - Confluent Cloud Accounts API + x-codegen-request-body-name: body + x-dd-ownership: + notification_configuration: + manual_escalation_policy: '[production][team][web-integrations]' + prod_high_urgency: '@pagerduty-web-integrations-high-urgency @slack-web-integrations-ops' + prod_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + slack_support_channel: '#web-integrations' + staging_high_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + staging_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + team: web-integrations + team_escalation: '[production][team][web-integrations]' + x-permission: + operator: OR + permissions: + - STANDARD + /api/v2/integrations/confluent-cloud/accounts/{account_id}: + delete: + description: Delete a Confluent account with the provided account ID. + operationId: ConfluentCloudPublic5 + parameters: + - description: None + in: path + name: account_id + required: true + schema: + type: string + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete Confluent account + tags: + - Confluent Cloud Accounts API + x-dd-ownership: + notification_configuration: + manual_escalation_policy: '[production][team][web-integrations]' + prod_high_urgency: '@pagerduty-web-integrations-high-urgency @slack-web-integrations-ops' + prod_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + slack_support_channel: '#web-integrations' + staging_high_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + staging_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + team: web-integrations + team_escalation: '[production][team][web-integrations]' + x-permission: + operator: OR + permissions: + - STANDARD + get: + description: Get the Confluent account with the provided account ID. + operationId: ConfluentCloudPublic2 + parameters: + - description: None + in: path + name: account_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AccountConfigResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get Confluent account + tags: + - Confluent Cloud Accounts API + x-dd-ownership: + notification_configuration: + manual_escalation_policy: '[production][team][web-integrations]' + prod_high_urgency: '@pagerduty-web-integrations-high-urgency @slack-web-integrations-ops' + prod_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + slack_support_channel: '#web-integrations' + staging_high_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + staging_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + team: web-integrations + team_escalation: '[production][team][web-integrations]' + x-permission: + operator: OR + permissions: + - STANDARD + patch: + description: Update the Confluent account with the provided account ID. + operationId: ConfluentCloudPublic4 + parameters: + - description: None + in: path + name: account_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAccountRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AccountConfigResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update Confluent account + tags: + - Confluent Cloud Accounts API + x-codegen-request-body-name: body + x-dd-ownership: + notification_configuration: + manual_escalation_policy: '[production][team][web-integrations]' + prod_high_urgency: '@pagerduty-web-integrations-high-urgency @slack-web-integrations-ops' + prod_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + slack_support_channel: '#web-integrations' + staging_high_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + staging_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + team: web-integrations + team_escalation: '[production][team][web-integrations]' + x-permission: + operator: OR + permissions: + - STANDARD + /api/v2/integrations/confluent-cloud/accounts/{account_id}/resources: + get: + description: Get a Confluent resource for the account associated with the provided + ID. + operationId: ConfluentCloudPublic6 + parameters: + - description: None + in: path + name: account_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AccountConfigResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List Confluent Account resources + tags: + - Confluent Cloud Accounts API + x-dd-ownership: + notification_configuration: + manual_escalation_policy: '[production][team][web-integrations]' + prod_high_urgency: '@pagerduty-web-integrations-high-urgency @slack-web-integrations-ops' + prod_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + slack_support_channel: '#web-integrations' + staging_high_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + staging_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + team: web-integrations + team_escalation: '[production][team][web-integrations]' + x-permission: + operator: OR + permissions: + - STANDARD + post: + description: Create a Confluent resource for the account associated with the + provided ID. + operationId: ConfluentCloudPublic8 + parameters: + - description: None + in: path + name: account_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConfluentCloudResourceRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/ConfluentCloudResourceResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Add resource to Confluent account + tags: + - Confluent Cloud Accounts API + x-codegen-request-body-name: body + x-dd-ownership: + notification_configuration: + manual_escalation_policy: '[production][team][web-integrations]' + prod_high_urgency: '@pagerduty-web-integrations-high-urgency @slack-web-integrations-ops' + prod_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + slack_support_channel: '#web-integrations' + staging_high_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + staging_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + team: web-integrations + team_escalation: '[production][team][web-integrations]' + x-permission: + operator: OR + permissions: + - STANDARD + /api/v2/integrations/confluent-cloud/accounts/{account_id}/resources/{resource_id}: + delete: + description: Delete a Confluent resource with the provided resource id for the + account associated with the provided account ID. + operationId: ConfluentCloudPublic10 + parameters: + - description: None + in: path + name: account_id + required: true + schema: + type: string + - description: None + in: path + name: resource_id + required: true + schema: + type: string + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete resource from Confluent account + tags: + - Confluent Cloud Accounts API + x-dd-ownership: + notification_configuration: + manual_escalation_policy: '[production][team][web-integrations]' + prod_high_urgency: '@pagerduty-web-integrations-high-urgency @slack-web-integrations-ops' + prod_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + slack_support_channel: '#web-integrations' + staging_high_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + staging_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + team: web-integrations + team_escalation: '[production][team][web-integrations]' + x-permission: + operator: OR + permissions: + - STANDARD + get: + description: Get a Confluent resource with the provided resource id for the + account associated with the provided account ID. + operationId: ConfluentCloudPublic7 + parameters: + - description: None + in: path + name: account_id + required: true + schema: + type: string + - description: None + in: path + name: resource_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConfluentCloudResourcesResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get resource from Confluent account + tags: + - Confluent Cloud Accounts API + x-dd-ownership: + notification_configuration: + manual_escalation_policy: '[production][team][web-integrations]' + prod_high_urgency: '@pagerduty-web-integrations-high-urgency @slack-web-integrations-ops' + prod_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + slack_support_channel: '#web-integrations' + staging_high_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + staging_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + team: web-integrations + team_escalation: '[production][team][web-integrations]' + x-permission: + operator: OR + permissions: + - STANDARD + patch: + description: Update a Confluent resource with the provided resource id for the + account associated with the provided account ID. + operationId: ConfluentCloudPublic9 + parameters: + - description: None + in: path + name: account_id + required: true + schema: + type: string + - description: None + in: path + name: resource_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateResourceRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConfluentCloudResourceResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update resource in Confluent account + tags: + - Confluent Cloud Accounts API + x-codegen-request-body-name: body + x-dd-ownership: + notification_configuration: + manual_escalation_policy: '[production][team][web-integrations]' + prod_high_urgency: '@pagerduty-web-integrations-high-urgency @slack-web-integrations-ops' + prod_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + slack_support_channel: '#web-integrations' + staging_high_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + staging_low_urgency: '@pagerduty-web-integrations-low-urgency @slack-web-integrations-ops' + team: web-integrations + team_escalation: '[production][team][web-integrations]' + x-permission: + operator: OR + permissions: + - STANDARD /api/v2/logs: post: description: 'Send your logs to your Datadog platform over HTTP. Limits per @@ -14523,6 +15445,9 @@ tags: - description: Workload activity security rules for generating events using the Datadog security Agent. name: Cloud Workload Security +- description: Configure your Datadog Confluent Cloud integration directly through + the Datadog API. + name: Confluent Cloud Accounts API - description: 'Interact with your dashboard lists through the API to organize, find, and share all of your dashboards with your team and diff --git a/docs/datadog_api_client.v1.model.rst b/docs/datadog_api_client.v1.model.rst index 60e19086df..d84988f787 100644 --- a/docs/datadog_api_client.v1.model.rst +++ b/docs/datadog_api_client.v1.model.rst @@ -2584,20 +2584,6 @@ scatterplot\_widget\_formula :members: :show-inheritance: -search\_service\_level\_objective ---------------------------------- - -.. automodule:: datadog_api_client.v1.model.search_service_level_objective - :members: - :show-inheritance: - -search\_slo\_query ------------------- - -.. automodule:: datadog_api_client.v1.model.search_slo_query - :members: - :show-inheritance: - search\_slo\_response --------------------- @@ -2661,20 +2647,6 @@ search\_slo\_response\_meta\_page :members: :show-inheritance: -search\_slo\_threshold ----------------------- - -.. automodule:: datadog_api_client.v1.model.search_slo_threshold - :members: - :show-inheritance: - -search\_slo\_timeframe ----------------------- - -.. automodule:: datadog_api_client.v1.model.search_slo_timeframe - :members: - :show-inheritance: - series ------ @@ -2920,13 +2892,6 @@ slo\_correction\_update\_request\_attributes :members: :show-inheritance: -slo\_creator ------------- - -.. automodule:: datadog_api_client.v1.model.slo_creator - :members: - :show-inheritance: - slo\_delete\_response --------------------- @@ -3039,20 +3004,6 @@ slo\_list\_response\_metadata\_page :members: :show-inheritance: -slo\_overall\_statuses ----------------------- - -.. automodule:: datadog_api_client.v1.model.slo_overall_statuses - :members: - :show-inheritance: - -slo\_raw\_error\_budget\_remaining ----------------------------------- - -.. automodule:: datadog_api_client.v1.model.slo_raw_error_budget_remaining - :members: - :show-inheritance: - slo\_response ------------- diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 6dfdb671c6..3b26eef657 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -22,6 +22,13 @@ cloud\_workload\_security\_api :members: :show-inheritance: +confluent\_cloud\_accounts\_api\_api +------------------------------------ + +.. automodule:: datadog_api_client.v2.api.confluent_cloud_accounts_api_api + :members: + :show-inheritance: + dashboard\_lists\_api --------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 71c37ce948..9c9d7ecef6 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -1,6 +1,69 @@ datadog\_api\_client.v2.model ============================= +account\_config +--------------- + +.. automodule:: datadog_api_client.v2.model.account_config + :members: + :show-inheritance: + +account\_config\_attributes +--------------------------- + +.. automodule:: datadog_api_client.v2.model.account_config_attributes + :members: + :show-inheritance: + +account\_config\_response +------------------------- + +.. automodule:: datadog_api_client.v2.model.account_config_response + :members: + :show-inheritance: + +account\_config\_type +--------------------- + +.. automodule:: datadog_api_client.v2.model.account_config_type + :members: + :show-inheritance: + +account\_configs\_response +-------------------------- + +.. automodule:: datadog_api_client.v2.model.account_configs_response + :members: + :show-inheritance: + +add\_account +------------ + +.. automodule:: datadog_api_client.v2.model.add_account + :members: + :show-inheritance: + +add\_account\_attributes +------------------------ + +.. automodule:: datadog_api_client.v2.model.add_account_attributes + :members: + :show-inheritance: + +add\_account\_request +--------------------- + +.. automodule:: datadog_api_client.v2.model.add_account_request + :members: + :show-inheritance: + +add\_account\_type +------------------ + +.. automodule:: datadog_api_client.v2.model.add_account_type + :members: + :show-inheritance: + api\_error\_response -------------------- @@ -477,6 +540,34 @@ cloud\_workload\_security\_agent\_rules\_list\_response :members: :show-inheritance: +confluent\_cloud\_resource +-------------------------- + +.. automodule:: datadog_api_client.v2.model.confluent_cloud_resource + :members: + :show-inheritance: + +confluent\_cloud\_resource\_request +----------------------------------- + +.. automodule:: datadog_api_client.v2.model.confluent_cloud_resource_request + :members: + :show-inheritance: + +confluent\_cloud\_resource\_response +------------------------------------ + +.. automodule:: datadog_api_client.v2.model.confluent_cloud_resource_response + :members: + :show-inheritance: + +confluent\_cloud\_resources\_response +------------------------------------- + +.. automodule:: datadog_api_client.v2.model.confluent_cloud_resources_response + :members: + :show-inheritance: + content\_encoding ----------------- @@ -3522,6 +3613,62 @@ service\_account\_create\_request :members: :show-inheritance: +update\_account +--------------- + +.. automodule:: datadog_api_client.v2.model.update_account + :members: + :show-inheritance: + +update\_account\_attributes +--------------------------- + +.. automodule:: datadog_api_client.v2.model.update_account_attributes + :members: + :show-inheritance: + +update\_account\_request +------------------------ + +.. automodule:: datadog_api_client.v2.model.update_account_request + :members: + :show-inheritance: + +update\_account\_type +--------------------- + +.. automodule:: datadog_api_client.v2.model.update_account_type + :members: + :show-inheritance: + +update\_resource +---------------- + +.. automodule:: datadog_api_client.v2.model.update_resource + :members: + :show-inheritance: + +update\_resource\_attributes +---------------------------- + +.. automodule:: datadog_api_client.v2.model.update_resource_attributes + :members: + :show-inheritance: + +update\_resource\_request +------------------------- + +.. automodule:: datadog_api_client.v2.model.update_resource_request + :members: + :show-inheritance: + +update\_resource\_type +---------------------- + +.. automodule:: datadog_api_client.v2.model.update_resource_type + :members: + :show-inheritance: + usage\_application\_security\_monitoring\_response -------------------------------------------------- diff --git a/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic1.py b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic1.py new file mode 100644 index 0000000000..69fd4ddf2f --- /dev/null +++ b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic1.py @@ -0,0 +1,13 @@ +""" +List Confluent accounts returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.confluent_cloud_accounts_api_api import ConfluentCloudAccountsAPIApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ConfluentCloudAccountsAPIApi(api_client) + response = api_instance.confluent_cloud_public1() + + print(response) diff --git a/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic2.py b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic2.py new file mode 100644 index 0000000000..26b461ca03 --- /dev/null +++ b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic2.py @@ -0,0 +1,19 @@ +""" +Get Confluent account returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.confluent_cloud_accounts_api_api import ConfluentCloudAccountsAPIApi + +# there is a valid "confluent_account" in the system +CONFLUENT_ACCOUNT_DATA_ID = environ["CONFLUENT_ACCOUNT_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ConfluentCloudAccountsAPIApi(api_client) + response = api_instance.confluent_cloud_public2( + account_id=CONFLUENT_ACCOUNT_DATA_ID, + ) + + print(response) diff --git a/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic3.py b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic3.py new file mode 100644 index 0000000000..6b5a3c2096 --- /dev/null +++ b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic3.py @@ -0,0 +1,42 @@ +""" +Add Confluent account returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.confluent_cloud_accounts_api_api import ConfluentCloudAccountsAPIApi +from datadog_api_client.v2.model.add_account import AddAccount +from datadog_api_client.v2.model.add_account_attributes import AddAccountAttributes +from datadog_api_client.v2.model.add_account_request import AddAccountRequest +from datadog_api_client.v2.model.add_account_type import AddAccountType +from datadog_api_client.v2.model.confluent_cloud_resource import ConfluentCloudResource + +body = AddAccountRequest( + data=AddAccount( + attributes=AddAccountAttributes( + api_key="TESTAPIKEY123", + api_secret="test-api-secret-123", + resources=[ + ConfluentCloudResource( + id="resource_id_abc123", + resource_type="kafka", + tags=[ + "myTag", + "myTag2:myValue", + ], + ), + ], + tags=[ + "myTag", + "myTag2:myValue", + ], + ), + type=AddAccountType.CONFLUENT_CLOUD_ACCOUNTS, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ConfluentCloudAccountsAPIApi(api_client) + response = api_instance.confluent_cloud_public3(body=body) + + print(response) diff --git a/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic4.py b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic4.py new file mode 100644 index 0000000000..af58a39298 --- /dev/null +++ b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic4.py @@ -0,0 +1,35 @@ +""" +Update Confluent account returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.confluent_cloud_accounts_api_api import ConfluentCloudAccountsAPIApi +from datadog_api_client.v2.model.update_account import UpdateAccount +from datadog_api_client.v2.model.update_account_attributes import UpdateAccountAttributes +from datadog_api_client.v2.model.update_account_request import UpdateAccountRequest +from datadog_api_client.v2.model.update_account_type import UpdateAccountType + +# there is a valid "confluent_account" in the system +CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY = environ["CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY"] +CONFLUENT_ACCOUNT_DATA_ID = environ["CONFLUENT_ACCOUNT_DATA_ID"] + +body = UpdateAccountRequest( + data=UpdateAccount( + attributes=UpdateAccountAttributes( + api_key=CONFLUENT_ACCOUNT_DATA_ATTRIBUTES_API_KEY, + api_secret="update-secret", + tags=[ + "updated_tag:val", + ], + ), + type=UpdateAccountType.CONFLUENT_CLOUD_ACCOUNTS, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ConfluentCloudAccountsAPIApi(api_client) + response = api_instance.confluent_cloud_public4(account_id=CONFLUENT_ACCOUNT_DATA_ID, body=body) + + print(response) diff --git a/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic5.py b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic5.py new file mode 100644 index 0000000000..adeefc1b8b --- /dev/null +++ b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic5.py @@ -0,0 +1,13 @@ +""" +Delete Confluent account returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.confluent_cloud_accounts_api_api import ConfluentCloudAccountsAPIApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ConfluentCloudAccountsAPIApi(api_client) + api_instance.confluent_cloud_public5( + account_id="account_id", + ) diff --git a/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic5_2919241291.py b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic5_2919241291.py new file mode 100644 index 0000000000..023eaf686d --- /dev/null +++ b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic5_2919241291.py @@ -0,0 +1,17 @@ +""" +Delete resource from Confluent account returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.confluent_cloud_accounts_api_api import ConfluentCloudAccountsAPIApi + +# there is a valid "confluent_account" in the system +CONFLUENT_ACCOUNT_DATA_ID = environ["CONFLUENT_ACCOUNT_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ConfluentCloudAccountsAPIApi(api_client) + api_instance.confluent_cloud_public5( + account_id=CONFLUENT_ACCOUNT_DATA_ID, + ) diff --git a/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic6.py b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic6.py new file mode 100644 index 0000000000..aa703dde64 --- /dev/null +++ b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic6.py @@ -0,0 +1,15 @@ +""" +List Confluent Account resources returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.confluent_cloud_accounts_api_api import ConfluentCloudAccountsAPIApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ConfluentCloudAccountsAPIApi(api_client) + response = api_instance.confluent_cloud_public6( + account_id="account_id", + ) + + print(response) diff --git a/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic7.py b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic7.py new file mode 100644 index 0000000000..22848685f8 --- /dev/null +++ b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic7.py @@ -0,0 +1,16 @@ +""" +Get resource from Confluent account returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.confluent_cloud_accounts_api_api import ConfluentCloudAccountsAPIApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ConfluentCloudAccountsAPIApi(api_client) + response = api_instance.confluent_cloud_public7( + account_id="account_id", + resource_id="resource_id", + ) + + print(response) diff --git a/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic8.py b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic8.py new file mode 100644 index 0000000000..b71cbc429f --- /dev/null +++ b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic8.py @@ -0,0 +1,26 @@ +""" +Add resource to Confluent account returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.confluent_cloud_accounts_api_api import ConfluentCloudAccountsAPIApi +from datadog_api_client.v2.model.confluent_cloud_resource import ConfluentCloudResource +from datadog_api_client.v2.model.confluent_cloud_resource_request import ConfluentCloudResourceRequest + +body = ConfluentCloudResourceRequest( + data=ConfluentCloudResource( + id="resource_id_abc123", + resource_type="kafka", + tags=[ + "myTag", + "myTag2:myValue", + ], + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ConfluentCloudAccountsAPIApi(api_client) + response = api_instance.confluent_cloud_public8(account_id="account_id", body=body) + + print(response) diff --git a/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic9.py b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic9.py new file mode 100644 index 0000000000..3e4ee57df1 --- /dev/null +++ b/examples/v2/confluent-cloud-accounts-api/ConfluentCloudPublic9.py @@ -0,0 +1,31 @@ +""" +Update resource in Confluent account returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.confluent_cloud_accounts_api_api import ConfluentCloudAccountsAPIApi +from datadog_api_client.v2.model.update_resource import UpdateResource +from datadog_api_client.v2.model.update_resource_attributes import UpdateResourceAttributes +from datadog_api_client.v2.model.update_resource_request import UpdateResourceRequest +from datadog_api_client.v2.model.update_resource_type import UpdateResourceType + +body = UpdateResourceRequest( + data=UpdateResource( + attributes=UpdateResourceAttributes( + resource_type="kafka", + tags=[ + "myTag", + "myTag2:myValue", + ], + ), + id="resource-id-123", + type=UpdateResourceType.CONFLUENT_CLOUD_RESOURCES, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ConfluentCloudAccountsAPIApi(api_client) + response = api_instance.confluent_cloud_public9(account_id="account_id", resource_id="resource_id", body=body) + + print(response) diff --git a/src/datadog_api_client/v1/api/service_level_objectives_api.py b/src/datadog_api_client/v1/api/service_level_objectives_api.py index 248997e1b3..4d49d7d36d 100644 --- a/src/datadog_api_client/v1/api/service_level_objectives_api.py +++ b/src/datadog_api_client/v1/api/service_level_objectives_api.py @@ -307,7 +307,6 @@ def __init__(self, api_client=None): "default_value": "datadoghq.com", "enum_values": [ "datadoghq.com", - "datadoghq.eu", "us3.datadoghq.com", "us5.datadoghq.com", "ddog-gov.com", @@ -363,11 +362,6 @@ def __init__(self, api_client=None): "attribute": "page[number]", "location": "query", }, - "include_facets": { - "openapi_types": (bool,), - "attribute": "include_facets", - "location": "query", - }, }, headers_map={ "accept": ["application/json"], @@ -630,22 +624,17 @@ def search_slo( query: Union[str, UnsetType] = unset, page_size: Union[int, UnsetType] = unset, page_number: Union[int, UnsetType] = unset, - include_facets: Union[bool, UnsetType] = unset, ) -> SearchSLOResponse: """Search for SLOs. Get a list of service level objective objects for your organization. :param query: The query string to filter results based on SLO names. - Some examples of queries include ``service:`` - and ````. :type query: str, optional :param page_size: The number of files to return in the response ``[default=10]``. :type page_size: int, optional :param page_number: The identifier of the first page to return. This parameter is used for the pagination feature ``[default=0]``. :type page_number: int, optional - :param include_facets: Whether or not to return facet information in the response ``[default=false]``. - :type include_facets: bool, optional :rtype: SearchSLOResponse """ kwargs: Dict[str, Any] = {} @@ -658,9 +647,6 @@ def search_slo( if page_number is not unset: kwargs["page_number"] = page_number - if include_facets is not unset: - kwargs["include_facets"] = include_facets - return self._search_slo_endpoint.call_with_http_info(**kwargs) def update_slo( diff --git a/src/datadog_api_client/v1/model/search_service_level_objective.py b/src/datadog_api_client/v1/model/search_service_level_objective.py deleted file mode 100644 index 3dd01c3982..0000000000 --- a/src/datadog_api_client/v1/model/search_service_level_objective.py +++ /dev/null @@ -1,124 +0,0 @@ -# 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 datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - none_type, -) - - -class SearchServiceLevelObjective(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v1.model.slo_creator import SLOCreator - from datadog_api_client.v1.model.slo_overall_statuses import SLOOverallStatuses - from datadog_api_client.v1.model.search_slo_query import SearchSLOQuery - from datadog_api_client.v1.model.search_slo_threshold import SearchSLOThreshold - from datadog_api_client.v1.model.slo_type import SLOType - - return { - "all_tags": ([str],), - "created_at": (int,), - "creator": (SLOCreator,), - "description": (str, none_type), - "groups": ([str], none_type), - "id": (str,), - "modified_at": (int,), - "monitor_ids": ([int], none_type), - "name": (str,), - "overall_status": ([SLOOverallStatuses],), - "query": (SearchSLOQuery,), - "thresholds": ([SearchSLOThreshold],), - "type": (SLOType,), - } - - attribute_map = { - "all_tags": "all_tags", - "created_at": "created_at", - "creator": "creator", - "description": "description", - "groups": "groups", - "id": "id", - "modified_at": "modified_at", - "monitor_ids": "monitor_ids", - "name": "name", - "overall_status": "overall_status", - "query": "query", - "thresholds": "thresholds", - "type": "type", - } - read_only_vars = { - "created_at", - "id", - "modified_at", - } - - def __init__(self_, *args, **kwargs): - """ - A service level objective object includes a service level indicator, thresholds - for one or more timeframes, and metadata ( ``name`` , ``description`` , ``tags`` , etc.). - - :param all_tags: A list of tags associated with this service level objective. - Always included in service level objective responses (but may be empty). - Optional in create/update requests. - :type all_tags: [str], optional - - :param created_at: Creation timestamp (UNIX time in seconds) - - Always included in service level objective responses. - :type created_at: int, optional - - :param creator: The creator of the SLO - :type creator: SLOCreator, none_type, optional - - :param description: A user-defined description of the service level objective. - - Always included in service level objective responses (but may be ``null`` ). - Optional in create/update requests. - :type description: str, none_type, optional - - :param groups: A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective. - - Included in service level objective responses if it is not empty. Optional in - create/update requests for monitor service level objectives, but may only be - used when then length of the ``monitor_ids`` field is one. - :type groups: [str], none_type, optional - - :param id: A unique identifier for the service level objective object. - - Always included in service level objective responses. - :type id: str, optional - - :param modified_at: Modification timestamp (UNIX time in seconds) - - Always included in service level objective responses. - :type modified_at: int, optional - - :param monitor_ids: A list of monitor ids that defines the scope of a monitor service level - objective. **Required if type is monitor**. - :type monitor_ids: [int], none_type, optional - - :param name: The name of the service level objective object. - :type name: str, optional - - :param overall_status: calculated status and error budget remaining. - :type overall_status: [SLOOverallStatuses], optional - - :param query: A metric-based SLO. **Required if type is metric**. Note that Datadog only allows the sum by aggregator - to be used because this will sum up all request counts instead of averaging them, or taking the max or - min of all of those requests. - :type query: SearchSLOQuery, none_type, optional - - :param thresholds: The thresholds (timeframes and associated targets) for this service level - objective object. - :type thresholds: [SearchSLOThreshold], optional - - :param type: The type of the service level objective. - :type type: SLOType, optional - """ - super().__init__(kwargs) - - self_._check_pos_args(args) diff --git a/src/datadog_api_client/v1/model/search_slo_query.py b/src/datadog_api_client/v1/model/search_slo_query.py deleted file mode 100644 index 6e41721209..0000000000 --- a/src/datadog_api_client/v1/model/search_slo_query.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - none_type, -) - - -class SearchSLOQuery(ModelNormal): - _nullable = True - - @cached_property - def openapi_types(_): - return { - "denominator": (str,), - "metrics": ([str], none_type), - "numerator": (str,), - } - - attribute_map = { - "denominator": "denominator", - "metrics": "metrics", - "numerator": "numerator", - } - - def __init__(self_, *args, **kwargs): - """ - A metric-based SLO. **Required if type is metric**. Note that Datadog only allows the sum by aggregator - to be used because this will sum up all request counts instead of averaging them, or taking the max or - min of all of those requests. - - :param denominator: A Datadog metric query for total (valid) events. - :type denominator: str, optional - - :param metrics: Metric names used in the query's numerator and denominator. - This field will return null and will be implemented in the next version of this endpoint. - :type metrics: [str], none_type, optional - - :param numerator: A Datadog metric query for good events. - :type numerator: str, optional - """ - super().__init__(kwargs) - - self_._check_pos_args(args) diff --git a/src/datadog_api_client/v1/model/search_slo_response_data_attributes.py b/src/datadog_api_client/v1/model/search_slo_response_data_attributes.py index 9125dbe361..0276df9587 100644 --- a/src/datadog_api_client/v1/model/search_slo_response_data_attributes.py +++ b/src/datadog_api_client/v1/model/search_slo_response_data_attributes.py @@ -15,11 +15,11 @@ def openapi_types(_): from datadog_api_client.v1.model.search_slo_response_data_attributes_facets import ( SearchSLOResponseDataAttributesFacets, ) - from datadog_api_client.v1.model.search_service_level_objective import SearchServiceLevelObjective + from datadog_api_client.v1.model.service_level_objective import ServiceLevelObjective return { "facets": (SearchSLOResponseDataAttributesFacets,), - "slo": ([SearchServiceLevelObjective],), + "slo": ([ServiceLevelObjective],), } attribute_map = { @@ -35,7 +35,7 @@ def __init__(self_, *args, **kwargs): :type facets: SearchSLOResponseDataAttributesFacets, optional :param slo: SLOs - :type slo: [SearchServiceLevelObjective], optional + :type slo: [ServiceLevelObjective], optional """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/model/search_slo_threshold.py b/src/datadog_api_client/v1/model/search_slo_threshold.py deleted file mode 100644 index cf8c917383..0000000000 --- a/src/datadog_api_client/v1/model/search_slo_threshold.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - none_type, -) - - -class SearchSLOThreshold(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v1.model.search_slo_timeframe import SearchSLOTimeframe - - return { - "target": (float,), - "target_display": (str,), - "timeframe": (SearchSLOTimeframe,), - "warning": (float, none_type), - "warning_display": (str, none_type), - } - - attribute_map = { - "target": "target", - "target_display": "target_display", - "timeframe": "timeframe", - "warning": "warning", - "warning_display": "warning_display", - } - - def __init__(self_, target, timeframe, *args, **kwargs): - """ - SLO thresholds (target and optionally warning) for a single time window. - - :param target: The target value for the service level indicator within the corresponding - timeframe. - :type target: float - - :param target_display: A string representation of the target that indicates its precision. - It uses trailing zeros to show significant decimal places (for example ``98.00`` ). - - Always included in service level objective responses. Ignored in - create/update requests. - :type target_display: str, optional - - :param timeframe: The SLO time window options. - :type timeframe: SearchSLOTimeframe - - :param warning: The warning value for the service level objective. - :type warning: float, none_type, optional - - :param warning_display: A string representation of the warning target (see the description of - the ``target_display`` field for details). - - Included in service level objective responses if a warning target exists. - Ignored in create/update requests. - :type warning_display: str, none_type, optional - """ - super().__init__(kwargs) - - self_._check_pos_args(args) - - self_.target = target - self_.timeframe = timeframe diff --git a/src/datadog_api_client/v1/model/slo_overall_statuses.py b/src/datadog_api_client/v1/model/slo_overall_statuses.py deleted file mode 100644 index ecfc0cd024..0000000000 --- a/src/datadog_api_client/v1/model/slo_overall_statuses.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - none_type, -) - - -class SLOOverallStatuses(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v1.model.slo_raw_error_budget_remaining import SLORawErrorBudgetRemaining - from datadog_api_client.v1.model.slo_timeframe import SLOTimeframe - - return { - "error": (str, none_type), - "indexed_at": (int,), - "raw_error_budget_remaining": (SLORawErrorBudgetRemaining,), - "span_precision": (int,), - "status": (float, none_type), - "target": (float,), - "timeframe": (SLOTimeframe,), - } - - attribute_map = { - "error": "error", - "indexed_at": "indexed_at", - "raw_error_budget_remaining": "raw_error_budget_remaining", - "span_precision": "span_precision", - "status": "status", - "target": "target", - "timeframe": "timeframe", - } - - def __init__(self_, *args, **kwargs): - """ - Overall status of the SLO by timeframes. - - :param error: Error message if SLO status or error budget could not be calculated. - :type error: str, none_type, optional - - :param indexed_at: timestamp (UNIX time in seconds) of when the SLO status and error budget - were calculated. - :type indexed_at: int, optional - - :param raw_error_budget_remaining: Error budget remaining for an SLO. - :type raw_error_budget_remaining: SLORawErrorBudgetRemaining, optional - - :param span_precision: The amount of decimal places the SLI value is accurate to. - :type span_precision: int, optional - - :param status: The status of the SLO. - :type status: float, none_type, optional - - :param target: The target of the SLO. - :type target: float, optional - - :param timeframe: The SLO time window options. - :type timeframe: SLOTimeframe, optional - """ - super().__init__(kwargs) - - self_._check_pos_args(args) diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index f9982a1e90..fdffb8b0c3 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -430,7 +430,6 @@ from datadog_api_client.v1.model.slo_correction_update_data import SLOCorrectionUpdateData from datadog_api_client.v1.model.slo_correction_update_request import SLOCorrectionUpdateRequest from datadog_api_client.v1.model.slo_correction_update_request_attributes import SLOCorrectionUpdateRequestAttributes -from datadog_api_client.v1.model.slo_creator import SLOCreator from datadog_api_client.v1.model.slo_delete_response import SLODeleteResponse from datadog_api_client.v1.model.slo_error_budget_remaining_data import SLOErrorBudgetRemainingData from datadog_api_client.v1.model.slo_error_timeframe import SLOErrorTimeframe @@ -447,8 +446,6 @@ from datadog_api_client.v1.model.slo_list_response import SLOListResponse from datadog_api_client.v1.model.slo_list_response_metadata import SLOListResponseMetadata from datadog_api_client.v1.model.slo_list_response_metadata_page import SLOListResponseMetadataPage -from datadog_api_client.v1.model.slo_overall_statuses import SLOOverallStatuses -from datadog_api_client.v1.model.slo_raw_error_budget_remaining import SLORawErrorBudgetRemaining from datadog_api_client.v1.model.slo_response import SLOResponse from datadog_api_client.v1.model.slo_response_data import SLOResponseData from datadog_api_client.v1.model.slo_threshold import SLOThreshold @@ -465,7 +462,6 @@ from datadog_api_client.v1.model.scatterplot_table_request import ScatterplotTableRequest from datadog_api_client.v1.model.scatterplot_widget_aggregator import ScatterplotWidgetAggregator from datadog_api_client.v1.model.scatterplot_widget_formula import ScatterplotWidgetFormula -from datadog_api_client.v1.model.search_slo_query import SearchSLOQuery from datadog_api_client.v1.model.search_slo_response import SearchSLOResponse from datadog_api_client.v1.model.search_slo_response_data import SearchSLOResponseData from datadog_api_client.v1.model.search_slo_response_data_attributes import SearchSLOResponseDataAttributes @@ -479,9 +475,6 @@ from datadog_api_client.v1.model.search_slo_response_links import SearchSLOResponseLinks from datadog_api_client.v1.model.search_slo_response_meta import SearchSLOResponseMeta from datadog_api_client.v1.model.search_slo_response_meta_page import SearchSLOResponseMetaPage -from datadog_api_client.v1.model.search_slo_threshold import SearchSLOThreshold -from datadog_api_client.v1.model.search_slo_timeframe import SearchSLOTimeframe -from datadog_api_client.v1.model.search_service_level_objective import SearchServiceLevelObjective from datadog_api_client.v1.model.series import Series from datadog_api_client.v1.model.service_check import ServiceCheck from datadog_api_client.v1.model.service_check_status import ServiceCheckStatus diff --git a/src/datadog_api_client/v2/api/confluent_cloud_accounts_api_api.py b/src/datadog_api_client/v2/api/confluent_cloud_accounts_api_api.py new file mode 100644 index 0000000000..1f07d30c6c --- /dev/null +++ b/src/datadog_api_client/v2/api/confluent_cloud_accounts_api_api.py @@ -0,0 +1,481 @@ +# 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 Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.v2.model.account_configs_response import AccountConfigsResponse +from datadog_api_client.v2.model.account_config_response import AccountConfigResponse +from datadog_api_client.v2.model.add_account_request import AddAccountRequest +from datadog_api_client.v2.model.update_account_request import UpdateAccountRequest +from datadog_api_client.v2.model.confluent_cloud_resource_response import ConfluentCloudResourceResponse +from datadog_api_client.v2.model.confluent_cloud_resource_request import ConfluentCloudResourceRequest +from datadog_api_client.v2.model.confluent_cloud_resources_response import ConfluentCloudResourcesResponse +from datadog_api_client.v2.model.update_resource_request import UpdateResourceRequest + + +class ConfluentCloudAccountsAPIApi: + """ + Configure your Datadog Confluent Cloud integration directly through the Datadog API. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + self._confluent_cloud_public1_endpoint = _Endpoint( + settings={ + "response_type": (AccountConfigsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integrations/confluent-cloud/accounts", + "operation_id": "confluent_cloud_public1", + "http_method": "GET", + "version": "v2", + "servers": None, + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + "content_type": [], + }, + api_client=api_client, + ) + + self._confluent_cloud_public10_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources/{resource_id}", + "operation_id": "confluent_cloud_public10", + "http_method": "DELETE", + "version": "v2", + "servers": None, + }, + params_map={ + "account_id": { + "required": True, + "openapi_types": (str,), + "attribute": "account_id", + "location": "path", + }, + "resource_id": { + "required": True, + "openapi_types": (str,), + "attribute": "resource_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + "content_type": [], + }, + api_client=api_client, + ) + + self._confluent_cloud_public2_endpoint = _Endpoint( + settings={ + "response_type": (AccountConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integrations/confluent-cloud/accounts/{account_id}", + "operation_id": "confluent_cloud_public2", + "http_method": "GET", + "version": "v2", + "servers": None, + }, + params_map={ + "account_id": { + "required": True, + "openapi_types": (str,), + "attribute": "account_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + "content_type": [], + }, + api_client=api_client, + ) + + self._confluent_cloud_public3_endpoint = _Endpoint( + settings={ + "response_type": (AccountConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integrations/confluent-cloud/accounts", + "operation_id": "confluent_cloud_public3", + "http_method": "POST", + "version": "v2", + "servers": None, + }, + params_map={ + "body": { + "required": True, + "openapi_types": (AddAccountRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._confluent_cloud_public4_endpoint = _Endpoint( + settings={ + "response_type": (AccountConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integrations/confluent-cloud/accounts/{account_id}", + "operation_id": "confluent_cloud_public4", + "http_method": "PATCH", + "version": "v2", + "servers": None, + }, + params_map={ + "account_id": { + "required": True, + "openapi_types": (str,), + "attribute": "account_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (UpdateAccountRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._confluent_cloud_public5_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integrations/confluent-cloud/accounts/{account_id}", + "operation_id": "confluent_cloud_public5", + "http_method": "DELETE", + "version": "v2", + "servers": None, + }, + params_map={ + "account_id": { + "required": True, + "openapi_types": (str,), + "attribute": "account_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + "content_type": [], + }, + api_client=api_client, + ) + + self._confluent_cloud_public6_endpoint = _Endpoint( + settings={ + "response_type": (AccountConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources", + "operation_id": "confluent_cloud_public6", + "http_method": "GET", + "version": "v2", + "servers": None, + }, + params_map={ + "account_id": { + "required": True, + "openapi_types": (str,), + "attribute": "account_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + "content_type": [], + }, + api_client=api_client, + ) + + self._confluent_cloud_public7_endpoint = _Endpoint( + settings={ + "response_type": (ConfluentCloudResourcesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources/{resource_id}", + "operation_id": "confluent_cloud_public7", + "http_method": "GET", + "version": "v2", + "servers": None, + }, + params_map={ + "account_id": { + "required": True, + "openapi_types": (str,), + "attribute": "account_id", + "location": "path", + }, + "resource_id": { + "required": True, + "openapi_types": (str,), + "attribute": "resource_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + "content_type": [], + }, + api_client=api_client, + ) + + self._confluent_cloud_public8_endpoint = _Endpoint( + settings={ + "response_type": (ConfluentCloudResourceResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources", + "operation_id": "confluent_cloud_public8", + "http_method": "POST", + "version": "v2", + "servers": None, + }, + params_map={ + "account_id": { + "required": True, + "openapi_types": (str,), + "attribute": "account_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (ConfluentCloudResourceRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._confluent_cloud_public9_endpoint = _Endpoint( + settings={ + "response_type": (ConfluentCloudResourceResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/integrations/confluent-cloud/accounts/{account_id}/resources/{resource_id}", + "operation_id": "confluent_cloud_public9", + "http_method": "PATCH", + "version": "v2", + "servers": None, + }, + params_map={ + "account_id": { + "required": True, + "openapi_types": (str,), + "attribute": "account_id", + "location": "path", + }, + "resource_id": { + "required": True, + "openapi_types": (str,), + "attribute": "resource_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (UpdateResourceRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def confluent_cloud_public1( + self, + ) -> AccountConfigsResponse: + """List Confluent accounts. + + Get a Confluent account with the provided account id. + + :rtype: AccountConfigsResponse + """ + kwargs: Dict[str, Any] = {} + return self._confluent_cloud_public1_endpoint.call_with_http_info(**kwargs) + + def confluent_cloud_public10( + self, + account_id: str, + resource_id: str, + ) -> None: + """Delete resource from Confluent account. + + Delete a Confluent resource with the provided resource id for the account associated with the provided account ID. + + :param account_id: None + :type account_id: str + :param resource_id: None + :type resource_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["account_id"] = account_id + + kwargs["resource_id"] = resource_id + + return self._confluent_cloud_public10_endpoint.call_with_http_info(**kwargs) + + def confluent_cloud_public2( + self, + account_id: str, + ) -> AccountConfigResponse: + """Get Confluent account. + + Get the Confluent account with the provided account ID. + + :param account_id: None + :type account_id: str + :rtype: AccountConfigResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["account_id"] = account_id + + return self._confluent_cloud_public2_endpoint.call_with_http_info(**kwargs) + + def confluent_cloud_public3( + self, + body: AddAccountRequest, + ) -> AccountConfigResponse: + """Add Confluent account. + + Create a Confluent account. + + :type body: AddAccountRequest + :rtype: AccountConfigResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._confluent_cloud_public3_endpoint.call_with_http_info(**kwargs) + + def confluent_cloud_public4( + self, + account_id: str, + body: UpdateAccountRequest, + ) -> AccountConfigResponse: + """Update Confluent account. + + Update the Confluent account with the provided account ID. + + :param account_id: None + :type account_id: str + :type body: UpdateAccountRequest + :rtype: AccountConfigResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["account_id"] = account_id + + kwargs["body"] = body + + return self._confluent_cloud_public4_endpoint.call_with_http_info(**kwargs) + + def confluent_cloud_public5( + self, + account_id: str, + ) -> None: + """Delete Confluent account. + + Delete a Confluent account with the provided account ID. + + :param account_id: None + :type account_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["account_id"] = account_id + + return self._confluent_cloud_public5_endpoint.call_with_http_info(**kwargs) + + def confluent_cloud_public6( + self, + account_id: str, + ) -> AccountConfigResponse: + """List Confluent Account resources. + + Get a Confluent resource for the account associated with the provided ID. + + :param account_id: None + :type account_id: str + :rtype: AccountConfigResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["account_id"] = account_id + + return self._confluent_cloud_public6_endpoint.call_with_http_info(**kwargs) + + def confluent_cloud_public7( + self, + account_id: str, + resource_id: str, + ) -> ConfluentCloudResourcesResponse: + """Get resource from Confluent account. + + Get a Confluent resource with the provided resource id for the account associated with the provided account ID. + + :param account_id: None + :type account_id: str + :param resource_id: None + :type resource_id: str + :rtype: ConfluentCloudResourcesResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["account_id"] = account_id + + kwargs["resource_id"] = resource_id + + return self._confluent_cloud_public7_endpoint.call_with_http_info(**kwargs) + + def confluent_cloud_public8( + self, + account_id: str, + body: ConfluentCloudResourceRequest, + ) -> ConfluentCloudResourceResponse: + """Add resource to Confluent account. + + Create a Confluent resource for the account associated with the provided ID. + + :param account_id: None + :type account_id: str + :type body: ConfluentCloudResourceRequest + :rtype: ConfluentCloudResourceResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["account_id"] = account_id + + kwargs["body"] = body + + return self._confluent_cloud_public8_endpoint.call_with_http_info(**kwargs) + + def confluent_cloud_public9( + self, + account_id: str, + resource_id: str, + body: UpdateResourceRequest, + ) -> ConfluentCloudResourceResponse: + """Update resource in Confluent account. + + Update a Confluent resource with the provided resource id for the account associated with the provided account ID. + + :param account_id: None + :type account_id: str + :param resource_id: None + :type resource_id: str + :type body: UpdateResourceRequest + :rtype: ConfluentCloudResourceResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["account_id"] = account_id + + kwargs["resource_id"] = resource_id + + kwargs["body"] = body + + return self._confluent_cloud_public9_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index c5e7ab2afd..98792c1bc2 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -1,6 +1,7 @@ from datadog_api_client.v2.api.audit_api import AuditApi from datadog_api_client.v2.api.authn_mappings_api import AuthNMappingsApi from datadog_api_client.v2.api.cloud_workload_security_api import CloudWorkloadSecurityApi +from datadog_api_client.v2.api.confluent_cloud_accounts_api_api import ConfluentCloudAccountsAPIApi from datadog_api_client.v2.api.dashboard_lists_api import DashboardListsApi from datadog_api_client.v2.api.events_api import EventsApi from datadog_api_client.v2.api.incident_services_api import IncidentServicesApi diff --git a/src/datadog_api_client/v2/model/account_config.py b/src/datadog_api_client/v2/model/account_config.py new file mode 100644 index 0000000000..4ce94aa79f --- /dev/null +++ b/src/datadog_api_client/v2/model/account_config.py @@ -0,0 +1,49 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class AccountConfig(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.account_config_attributes import AccountConfigAttributes + from datadog_api_client.v2.model.account_config_type import AccountConfigType + + return { + "attributes": (AccountConfigAttributes,), + "id": (str,), + "type": (AccountConfigType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes, id, type, *args, **kwargs): + """ + An API key and API secret pair that represents a Confluent account. + + :param attributes: The attributes of a Confluent account. + :type attributes: AccountConfigAttributes + + :param id: A randomly generated ID associated with a Confluent account. + :type id: str + + :param type: The JSON:API type for this API. Should always be ``confluent-cloud-accounts``. + :type type: AccountConfigType + """ + super().__init__(kwargs) + + self_._check_pos_args(args) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/account_config_attributes.py b/src/datadog_api_client/v2/model/account_config_attributes.py new file mode 100644 index 0000000000..e04ebc5977 --- /dev/null +++ b/src/datadog_api_client/v2/model/account_config_attributes.py @@ -0,0 +1,52 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class AccountConfigAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.confluent_cloud_resource import ConfluentCloudResource + + return { + "api_key": (str,), + "api_secret": (str,), + "resources": ([ConfluentCloudResource],), + "tags": ([str],), + } + + attribute_map = { + "api_key": "api_key", + "api_secret": "api_secret", + "resources": "resources", + "tags": "tags", + } + + def __init__(self_, api_key, api_secret, *args, **kwargs): + """ + The attributes of a Confluent account. + + :param api_key: The API key associated with your Confluent account. + :type api_key: str + + :param api_secret: The API secret associated with your Confluent account. + :type api_secret: str + + :param resources: A list of Confluent resources associated with the Confluent account. + :type resources: [ConfluentCloudResource], optional + + :param tags: A comma-delimited string representation of tags. Can be a single key, or key-value pairs separated by a colon. + :type tags: [str], optional + """ + super().__init__(kwargs) + + self_._check_pos_args(args) + + self_.api_key = api_key + self_.api_secret = api_secret diff --git a/src/datadog_api_client/v1/model/slo_creator.py b/src/datadog_api_client/v2/model/account_config_response.py similarity index 54% rename from src/datadog_api_client/v1/model/slo_creator.py rename to src/datadog_api_client/v2/model/account_config_response.py index 570ecda70a..402cfbaad1 100644 --- a/src/datadog_api_client/v1/model/slo_creator.py +++ b/src/datadog_api_client/v2/model/account_config_response.py @@ -9,35 +9,25 @@ ) -class SLOCreator(ModelNormal): - _nullable = True - +class AccountConfigResponse(ModelNormal): @cached_property def openapi_types(_): + from datadog_api_client.v2.model.account_config import AccountConfig + return { - "email": (str,), - "id": (str,), - "name": (str,), + "data": (AccountConfig,), } attribute_map = { - "email": "email", - "id": "id", - "name": "name", + "data": "data", } def __init__(self_, *args, **kwargs): """ - The creator of the SLO - - :param email: Email of the creator. - :type email: str, optional - - :param id: User ID of the creator. - :type id: str, optional + The expected response schema when getting a Confluent account. - :param name: Name of the creator. - :type name: str, optional + :param data: An API key and API secret pair that represents a Confluent account. + :type data: AccountConfig, optional """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/model/search_slo_timeframe.py b/src/datadog_api_client/v2/model/account_config_type.py similarity index 51% rename from src/datadog_api_client/v1/model/search_slo_timeframe.py rename to src/datadog_api_client/v2/model/account_config_type.py index 38b9008fcd..5d17672d44 100644 --- a/src/datadog_api_client/v1/model/search_slo_timeframe.py +++ b/src/datadog_api_client/v2/model/account_config_type.py @@ -11,22 +11,18 @@ from typing import ClassVar -class SearchSLOTimeframe(ModelSimple): +class AccountConfigType(ModelSimple): """ - The SLO time window options. + The JSON:API type for this API. Should always be `confluent-cloud-accounts`. - :param value: Must be one of ["7d", "30d", "90d"]. + :param value: If omitted defaults to "confluent-cloud-accounts". Must be one of ["confluent-cloud-accounts"]. :type value: str """ allowed_values = { - "7d", - "30d", - "90d", + "confluent-cloud-accounts", } - SEVEN_DAYS: ClassVar["SearchSLOTimeframe"] - THIRTY_DAYS: ClassVar["SearchSLOTimeframe"] - NINETY_DAYS: ClassVar["SearchSLOTimeframe"] + CONFLUENT_CLOUD_ACCOUNTS: ClassVar["AccountConfigType"] @cached_property def openapi_types(_): @@ -35,6 +31,4 @@ def openapi_types(_): } -SearchSLOTimeframe.SEVEN_DAYS = SearchSLOTimeframe("7d") -SearchSLOTimeframe.THIRTY_DAYS = SearchSLOTimeframe("30d") -SearchSLOTimeframe.NINETY_DAYS = SearchSLOTimeframe("90d") +AccountConfigType.CONFLUENT_CLOUD_ACCOUNTS = AccountConfigType("confluent-cloud-accounts") diff --git a/src/datadog_api_client/v1/model/slo_raw_error_budget_remaining.py b/src/datadog_api_client/v2/model/account_configs_response.py similarity index 60% rename from src/datadog_api_client/v1/model/slo_raw_error_budget_remaining.py rename to src/datadog_api_client/v2/model/account_configs_response.py index 7c55728c5d..da04572a5e 100644 --- a/src/datadog_api_client/v1/model/slo_raw_error_budget_remaining.py +++ b/src/datadog_api_client/v2/model/account_configs_response.py @@ -9,28 +9,25 @@ ) -class SLORawErrorBudgetRemaining(ModelNormal): +class AccountConfigsResponse(ModelNormal): @cached_property def openapi_types(_): + from datadog_api_client.v2.model.account_config import AccountConfig + return { - "unit": (str,), - "value": (float,), + "data": ([AccountConfig],), } attribute_map = { - "unit": "unit", - "value": "value", + "data": "data", } def __init__(self_, *args, **kwargs): """ - Error budget remaining for an SLO. - - :param unit: Error budget remaining unit. - :type unit: str, optional + Confluent account returned by the API. - :param value: Error budget remaining value. - :type value: float, optional + :param data: The Confluent account. + :type data: [AccountConfig], optional """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/add_account.py b/src/datadog_api_client/v2/model/add_account.py new file mode 100644 index 0000000000..53f7e66b49 --- /dev/null +++ b/src/datadog_api_client/v2/model/add_account.py @@ -0,0 +1,43 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class AddAccount(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.add_account_attributes import AddAccountAttributes + from datadog_api_client.v2.model.add_account_type import AddAccountType + + return { + "attributes": (AddAccountAttributes,), + "type": (AddAccountType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes, type, *args, **kwargs): + """ + The data body for adding a Confluent account. + + :param attributes: Attributes associated with the account creation request. + :type attributes: AddAccountAttributes + + :param type: The JSON:API type. Will always be ``confluent-cloud-accounts``. + :type type: AddAccountType + """ + super().__init__(kwargs) + + self_._check_pos_args(args) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/add_account_attributes.py b/src/datadog_api_client/v2/model/add_account_attributes.py new file mode 100644 index 0000000000..0e23beb5f0 --- /dev/null +++ b/src/datadog_api_client/v2/model/add_account_attributes.py @@ -0,0 +1,52 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class AddAccountAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.confluent_cloud_resource import ConfluentCloudResource + + return { + "api_key": (str,), + "api_secret": (str,), + "resources": ([ConfluentCloudResource],), + "tags": ([str],), + } + + attribute_map = { + "api_key": "api_key", + "api_secret": "api_secret", + "resources": "resources", + "tags": "tags", + } + + def __init__(self_, api_key, api_secret, *args, **kwargs): + """ + Attributes associated with the account creation request. + + :param api_key: The API key associated with your Confluent account. + :type api_key: str + + :param api_secret: The API secret associated with your Confluent account. + :type api_secret: str + + :param resources: A list of Confluent resources associated with the Confluent account. + :type resources: [ConfluentCloudResource], optional + + :param tags: A comma-delimited string representation of tags. Can be a single key, or key-value pairs separated by a colon. + :type tags: [str], optional + """ + super().__init__(kwargs) + + self_._check_pos_args(args) + + self_.api_key = api_key + self_.api_secret = api_secret diff --git a/src/datadog_api_client/v2/model/add_account_request.py b/src/datadog_api_client/v2/model/add_account_request.py new file mode 100644 index 0000000000..b94147d9ee --- /dev/null +++ b/src/datadog_api_client/v2/model/add_account_request.py @@ -0,0 +1,36 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class AddAccountRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.add_account import AddAccount + + return { + "data": (AddAccount,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data, *args, **kwargs): + """ + Payload schema when adding a Confluent account. + + :param data: The data body for adding a Confluent account. + :type data: AddAccount + """ + super().__init__(kwargs) + + self_._check_pos_args(args) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/add_account_type.py b/src/datadog_api_client/v2/model/add_account_type.py new file mode 100644 index 0000000000..b96e970af7 --- /dev/null +++ b/src/datadog_api_client/v2/model/add_account_type.py @@ -0,0 +1,34 @@ +# 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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AddAccountType(ModelSimple): + """ + The JSON:API type. Will always be `confluent-cloud-accounts`. + + :param value: If omitted defaults to "confluent-cloud-accounts". Must be one of ["confluent-cloud-accounts"]. + :type value: str + """ + + allowed_values = { + "confluent-cloud-accounts", + } + CONFLUENT_CLOUD_ACCOUNTS: ClassVar["AddAccountType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AddAccountType.CONFLUENT_CLOUD_ACCOUNTS = AddAccountType("confluent-cloud-accounts") diff --git a/src/datadog_api_client/v2/model/confluent_cloud_resource.py b/src/datadog_api_client/v2/model/confluent_cloud_resource.py new file mode 100644 index 0000000000..fa16d0e59a --- /dev/null +++ b/src/datadog_api_client/v2/model/confluent_cloud_resource.py @@ -0,0 +1,45 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ConfluentCloudResource(ModelNormal): + @cached_property + def openapi_types(_): + return { + "id": (str,), + "resource_type": (str,), + "tags": ([str],), + } + + attribute_map = { + "id": "id", + "resource_type": "resource_type", + "tags": "tags", + } + + def __init__(self_, id, resource_type, *args, **kwargs): + """ + Model representation of a Confluent Cloud resource. + + :param id: The ID associated with the Confluent resource. + :type id: str + + :param resource_type: The resource type of the Resource. Can be ``kafka`` , ``connector`` , ``ksql`` , or ``schema_registry``. + :type resource_type: str + + :param tags: A comma-delimited string representation of tags. Can be a single key, or key-value pairs separated by a colon. + :type tags: [str], optional + """ + super().__init__(kwargs) + + self_._check_pos_args(args) + + self_.id = id + self_.resource_type = resource_type diff --git a/src/datadog_api_client/v2/model/confluent_cloud_resource_request.py b/src/datadog_api_client/v2/model/confluent_cloud_resource_request.py new file mode 100644 index 0000000000..ea90b9854a --- /dev/null +++ b/src/datadog_api_client/v2/model/confluent_cloud_resource_request.py @@ -0,0 +1,36 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ConfluentCloudResourceRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.confluent_cloud_resource import ConfluentCloudResource + + return { + "data": (ConfluentCloudResource,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data, *args, **kwargs): + """ + Payload schema when interacting with a Confluent resource. + + :param data: Model representation of a Confluent Cloud resource. + :type data: ConfluentCloudResource + """ + super().__init__(kwargs) + + self_._check_pos_args(args) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/confluent_cloud_resource_response.py b/src/datadog_api_client/v2/model/confluent_cloud_resource_response.py new file mode 100644 index 0000000000..bd840210cc --- /dev/null +++ b/src/datadog_api_client/v2/model/confluent_cloud_resource_response.py @@ -0,0 +1,34 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ConfluentCloudResourceResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.confluent_cloud_resource import ConfluentCloudResource + + return { + "data": (ConfluentCloudResource,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, *args, **kwargs): + """ + Response schema when interacting with a Confluent resource. + + :param data: Model representation of a Confluent Cloud resource. + :type data: ConfluentCloudResource, optional + """ + super().__init__(kwargs) + + self_._check_pos_args(args) diff --git a/src/datadog_api_client/v2/model/confluent_cloud_resources_response.py b/src/datadog_api_client/v2/model/confluent_cloud_resources_response.py new file mode 100644 index 0000000000..0397f63529 --- /dev/null +++ b/src/datadog_api_client/v2/model/confluent_cloud_resources_response.py @@ -0,0 +1,34 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ConfluentCloudResourcesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.confluent_cloud_resource import ConfluentCloudResource + + return { + "data": ([ConfluentCloudResource],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, *args, **kwargs): + """ + Response schema when interacting with a list of Confluent resources. + + :param data: The JSON:API data attribute. + :type data: [ConfluentCloudResource], optional + """ + super().__init__(kwargs) + + self_._check_pos_args(args) diff --git a/src/datadog_api_client/v2/model/update_account.py b/src/datadog_api_client/v2/model/update_account.py new file mode 100644 index 0000000000..3e18fe3cc9 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_account.py @@ -0,0 +1,43 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class UpdateAccount(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_account_attributes import UpdateAccountAttributes + from datadog_api_client.v2.model.update_account_type import UpdateAccountType + + return { + "attributes": (UpdateAccountAttributes,), + "type": (UpdateAccountType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__(self_, attributes, type, *args, **kwargs): + """ + Data object for updating a Confluent account. + + :param attributes: Attributes object for updating a Confluent account. + :type attributes: UpdateAccountAttributes + + :param type: The JSON:API type for this request. + :type type: UpdateAccountType + """ + super().__init__(kwargs) + + self_._check_pos_args(args) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/update_account_attributes.py b/src/datadog_api_client/v2/model/update_account_attributes.py new file mode 100644 index 0000000000..bd079729d0 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_account_attributes.py @@ -0,0 +1,45 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class UpdateAccountAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "api_key": (str,), + "api_secret": (str,), + "tags": ([str],), + } + + attribute_map = { + "api_key": "api_key", + "api_secret": "api_secret", + "tags": "tags", + } + + def __init__(self_, api_key, api_secret, *args, **kwargs): + """ + Attributes object for updating a Confluent account. + + :param api_key: The API key associated with your Confluent account. + :type api_key: str + + :param api_secret: The API secret associated with your Confluent account. + :type api_secret: str + + :param tags: A comma-delimited string representation of tags. Can be a single key, or key-value pairs separated by a colon. + :type tags: [str], optional + """ + super().__init__(kwargs) + + self_._check_pos_args(args) + + self_.api_key = api_key + self_.api_secret = api_secret diff --git a/src/datadog_api_client/v2/model/update_account_request.py b/src/datadog_api_client/v2/model/update_account_request.py new file mode 100644 index 0000000000..6e6a7d8f93 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_account_request.py @@ -0,0 +1,36 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class UpdateAccountRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_account import UpdateAccount + + return { + "data": (UpdateAccount,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data, *args, **kwargs): + """ + The JSON:API request for updating a Confluent account. + + :param data: Data object for updating a Confluent account. + :type data: UpdateAccount + """ + super().__init__(kwargs) + + self_._check_pos_args(args) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/update_account_type.py b/src/datadog_api_client/v2/model/update_account_type.py new file mode 100644 index 0000000000..13e20e54d6 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_account_type.py @@ -0,0 +1,34 @@ +# 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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class UpdateAccountType(ModelSimple): + """ + The JSON:API type for this request. + + :param value: If omitted defaults to "confluent-cloud-accounts". Must be one of ["confluent-cloud-accounts"]. + :type value: str + """ + + allowed_values = { + "confluent-cloud-accounts", + } + CONFLUENT_CLOUD_ACCOUNTS: ClassVar["UpdateAccountType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +UpdateAccountType.CONFLUENT_CLOUD_ACCOUNTS = UpdateAccountType("confluent-cloud-accounts") diff --git a/src/datadog_api_client/v2/model/update_resource.py b/src/datadog_api_client/v2/model/update_resource.py new file mode 100644 index 0000000000..206543f1f5 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_resource.py @@ -0,0 +1,48 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class UpdateResource(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_resource_attributes import UpdateResourceAttributes + from datadog_api_client.v2.model.update_resource_type import UpdateResourceType + + return { + "attributes": (UpdateResourceAttributes,), + "id": (str,), + "type": (UpdateResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, id, type, *args, **kwargs): + """ + JSON:API request for updating a Confluent resource. + + :param attributes: Attributes object for updating a Confluent resource. + :type attributes: UpdateResourceAttributes, optional + + :param id: The ID associated with a Confluent resource. + :type id: str + + :param type: The JSON:API type for this request. + :type type: UpdateResourceType + """ + super().__init__(kwargs) + + self_._check_pos_args(args) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/update_resource_attributes.py b/src/datadog_api_client/v2/model/update_resource_attributes.py new file mode 100644 index 0000000000..452c11218f --- /dev/null +++ b/src/datadog_api_client/v2/model/update_resource_attributes.py @@ -0,0 +1,37 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class UpdateResourceAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "resource_type": (str,), + "tags": ([str],), + } + + attribute_map = { + "resource_type": "resource_type", + "tags": "tags", + } + + def __init__(self_, *args, **kwargs): + """ + Attributes object for updating a Confluent resource. + + :param resource_type: The resource type of the Resource. Can be ``kafka`` , ``connector`` , ``ksql`` , or ``schema_registry``. + :type resource_type: str, optional + + :param tags: A comma-delimited string representation of tags. Can be a single key, or key-value pairs separated by a colon. + :type tags: [str], optional + """ + super().__init__(kwargs) + + self_._check_pos_args(args) diff --git a/src/datadog_api_client/v2/model/update_resource_request.py b/src/datadog_api_client/v2/model/update_resource_request.py new file mode 100644 index 0000000000..fb2de17a1b --- /dev/null +++ b/src/datadog_api_client/v2/model/update_resource_request.py @@ -0,0 +1,36 @@ +# 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 datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class UpdateResourceRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.update_resource import UpdateResource + + return { + "data": (UpdateResource,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data, *args, **kwargs): + """ + The JSON:API request for updating a Confluent resource. + + :param data: JSON:API request for updating a Confluent resource. + :type data: UpdateResource + """ + super().__init__(kwargs) + + self_._check_pos_args(args) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/update_resource_type.py b/src/datadog_api_client/v2/model/update_resource_type.py new file mode 100644 index 0000000000..4229cb4d83 --- /dev/null +++ b/src/datadog_api_client/v2/model/update_resource_type.py @@ -0,0 +1,34 @@ +# 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 datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class UpdateResourceType(ModelSimple): + """ + The JSON:API type for this request. + + :param value: If omitted defaults to "confluent-cloud-resources". Must be one of ["confluent-cloud-resources"]. + :type value: str + """ + + allowed_values = { + "confluent-cloud-resources", + } + CONFLUENT_CLOUD_RESOURCES: ClassVar["UpdateResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +UpdateResourceType.CONFLUENT_CLOUD_RESOURCES = UpdateResourceType("confluent-cloud-resources") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 43a3de24cd..4fabd44d71 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -11,6 +11,15 @@ from datadog_api_client.v2.model.api_keys_response import APIKeysResponse from datadog_api_client.v2.model.api_keys_sort import APIKeysSort from datadog_api_client.v2.model.api_keys_type import APIKeysType +from datadog_api_client.v2.model.account_config import AccountConfig +from datadog_api_client.v2.model.account_config_attributes import AccountConfigAttributes +from datadog_api_client.v2.model.account_config_response import AccountConfigResponse +from datadog_api_client.v2.model.account_config_type import AccountConfigType +from datadog_api_client.v2.model.account_configs_response import AccountConfigsResponse +from datadog_api_client.v2.model.add_account import AddAccount +from datadog_api_client.v2.model.add_account_attributes import AddAccountAttributes +from datadog_api_client.v2.model.add_account_request import AddAccountRequest +from datadog_api_client.v2.model.add_account_type import AddAccountType from datadog_api_client.v2.model.application_key_create_attributes import ApplicationKeyCreateAttributes from datadog_api_client.v2.model.application_key_create_data import ApplicationKeyCreateData from datadog_api_client.v2.model.application_key_create_request import ApplicationKeyCreateRequest @@ -88,6 +97,10 @@ from datadog_api_client.v2.model.cloud_workload_security_agent_rules_list_response import ( CloudWorkloadSecurityAgentRulesListResponse, ) +from datadog_api_client.v2.model.confluent_cloud_resource import ConfluentCloudResource +from datadog_api_client.v2.model.confluent_cloud_resource_request import ConfluentCloudResourceRequest +from datadog_api_client.v2.model.confluent_cloud_resource_response import ConfluentCloudResourceResponse +from datadog_api_client.v2.model.confluent_cloud_resources_response import ConfluentCloudResourcesResponse from datadog_api_client.v2.model.content_encoding import ContentEncoding from datadog_api_client.v2.model.cost_by_org import CostByOrg from datadog_api_client.v2.model.cost_by_org_attributes import CostByOrgAttributes @@ -603,6 +616,14 @@ from datadog_api_client.v2.model.service_account_create_attributes import ServiceAccountCreateAttributes from datadog_api_client.v2.model.service_account_create_data import ServiceAccountCreateData from datadog_api_client.v2.model.service_account_create_request import ServiceAccountCreateRequest +from datadog_api_client.v2.model.update_account import UpdateAccount +from datadog_api_client.v2.model.update_account_attributes import UpdateAccountAttributes +from datadog_api_client.v2.model.update_account_request import UpdateAccountRequest +from datadog_api_client.v2.model.update_account_type import UpdateAccountType +from datadog_api_client.v2.model.update_resource import UpdateResource +from datadog_api_client.v2.model.update_resource_attributes import UpdateResourceAttributes +from datadog_api_client.v2.model.update_resource_request import UpdateResourceRequest +from datadog_api_client.v2.model.update_resource_type import UpdateResourceType from datadog_api_client.v2.model.usage_application_security_monitoring_response import ( UsageApplicationSecurityMonitoringResponse, ) diff --git a/tests/v2/features/confluent_cloud_accounts_api.feature b/tests/v2/features/confluent_cloud_accounts_api.feature new file mode 100644 index 0000000000..1fc80edc0d --- /dev/null +++ b/tests/v2/features/confluent_cloud_accounts_api.feature @@ -0,0 +1,164 @@ +@endpoint(confluent-cloud-accounts-api) @endpoint(confluent-cloud-accounts-api-v2) +Feature: Confluent Cloud Accounts API + Configure your Datadog Confluent Cloud integration directly through the + Datadog API. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "ConfluentCloudAccountsAPI" API + + @generated @skip @team:Datadog/web-integrations + Scenario: Add Confluent account returns "API error response." response + Given new "ConfluentCloudPublic3" request + And body with value {"data": {"attributes": {"api_key": "TESTAPIKEY123", "api_secret": "test-api-secret-123", "resources": [{"id": "resource_id_abc123", "resource_type": "kafka", "tags": ["myTag", "myTag2:myValue"]}], "tags": ["myTag", "myTag2:myValue"]}, "type": "confluent-cloud-accounts"}} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:Datadog/web-integrations + Scenario: Add Confluent account returns "OK" response + Given new "ConfluentCloudPublic3" request + And body with value {"data": {"attributes": {"api_key": "TESTAPIKEY123", "api_secret": "test-api-secret-123", "resources": [{"id": "resource_id_abc123", "resource_type": "kafka", "tags": ["myTag", "myTag2:myValue"]}], "tags": ["myTag", "myTag2:myValue"]}, "type": "confluent-cloud-accounts"}} + When the request is sent + Then the response status is 201 OK + + @generated @skip @team:Datadog/web-integrations + Scenario: Add resource to Confluent account returns "API error response." response + Given new "ConfluentCloudPublic8" request + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"id": "resource_id_abc123", "resource_type": "kafka", "tags": ["myTag", "myTag2:myValue"]}} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:Datadog/web-integrations + Scenario: Add resource to Confluent account returns "OK" response + Given new "ConfluentCloudPublic8" request + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"id": "resource_id_abc123", "resource_type": "kafka", "tags": ["myTag", "myTag2:myValue"]}} + When the request is sent + Then the response status is 201 OK + + @generated @skip @team:Datadog/web-integrations + Scenario: Delete Confluent account returns "API error response." response + Given new "ConfluentCloudPublic5" request + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:Datadog/web-integrations + Scenario: Delete Confluent account returns "OK" response + Given new "ConfluentCloudPublic5" request + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + + @generated @skip @team:Datadog/web-integrations + Scenario: Delete resource from Confluent account returns "API error response." response + Given new "ConfluentCloudPublic10" request + And request contains "account_id" parameter from "REPLACE.ME" + And request contains "resource_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @team:Datadog/web-integrations + Scenario: Delete resource from Confluent account returns "OK" response + Given there is a valid "confluent_account" in the system + And new "ConfluentCloudPublic5" request + And request contains "account_id" parameter from "confluent_account.data.id" + When the request is sent + Then the response status is 204 OK + + @generated @skip @team:Datadog/web-integrations + Scenario: Get Confluent account returns "API error response." response + Given new "ConfluentCloudPublic2" request + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @team:Datadog/web-integrations + Scenario: Get Confluent account returns "OK" response + Given there is a valid "confluent_account" in the system + And new "ConfluentCloudPublic2" request + And request contains "account_id" parameter from "confluent_account.data.id" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/web-integrations + Scenario: Get resource from Confluent account returns "API error response." response + Given new "ConfluentCloudPublic7" request + And request contains "account_id" parameter from "REPLACE.ME" + And request contains "resource_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:Datadog/web-integrations + Scenario: Get resource from Confluent account returns "OK" response + Given new "ConfluentCloudPublic7" request + And request contains "account_id" parameter from "REPLACE.ME" + And request contains "resource_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/web-integrations + Scenario: List Confluent Account resources returns "API error response." response + Given new "ConfluentCloudPublic6" request + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:Datadog/web-integrations + Scenario: List Confluent Account resources returns "OK" response + Given new "ConfluentCloudPublic6" request + And request contains "account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/web-integrations + Scenario: List Confluent accounts returns "API error response." response + Given new "ConfluentCloudPublic1" request + When the request is sent + Then the response status is 404 API error response. + + @team:Datadog/web-integrations + Scenario: List Confluent accounts returns "OK" response + Given there is a valid "confluent_account" in the system + And new "ConfluentCloudPublic1" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:Datadog/web-integrations + Scenario: Update Confluent account returns "API error response." response + Given new "ConfluentCloudPublic4" request + And request contains "account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"api_key": "TESTAPIKEY123", "api_secret": "test-api-secret-123", "tags": ["myTag", "myTag2:myValue"]}, "type": "confluent-cloud-accounts"}} + When the request is sent + Then the response status is 404 API error response. + + @team:Datadog/web-integrations + Scenario: Update Confluent account returns "OK" response + Given there is a valid "confluent_account" in the system + And new "ConfluentCloudPublic4" request + And request contains "account_id" parameter from "confluent_account.data.id" + And body with value {"data": {"attributes": {"api_key": "{{confluent_account.data.attributes.api_key}}", "api_secret": "update-secret", "tags": ["updated_tag:val"]}, "type": "confluent-cloud-accounts"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.tags[0]" is equal to "updated_tag:val" + And the response "data.attributes.api_key" is equal to "{{ confluent_account.data.attributes.api_key }}" + + @generated @skip @team:Datadog/web-integrations + Scenario: Update resource in Confluent account returns "API error response." response + Given new "ConfluentCloudPublic9" request + And request contains "account_id" parameter from "REPLACE.ME" + And request contains "resource_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"resource_type": "kafka", "tags": ["myTag", "myTag2:myValue"]}, "id": "resource-id-123", "type": "confluent-cloud-resources"}} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:Datadog/web-integrations + Scenario: Update resource in Confluent account returns "OK" response + Given new "ConfluentCloudPublic9" request + And request contains "account_id" parameter from "REPLACE.ME" + And request contains "resource_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"resource_type": "kafka", "tags": ["myTag", "myTag2:myValue"]}, "id": "resource-id-123", "type": "confluent-cloud-resources"}} + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index e8efb57464..2acdc9de9d 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -91,6 +91,18 @@ "tag": "Opsgenie Integration", "operationId": "CreateOpsgenieService" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"confluent-cloud-accounts\",\n \"attributes\": {\n \"api_key\": \"{{ unique_alnum }}\",\n \"api_secret\": \"test-api-secret\",\n \"tags\": [\n \"tag1\",\n \"tag2:val2\"\n ],\n \"resources\": [\n {\n \"id\": \"test-resource-id\",\n \"resource_type\": \"kafka\",\n \"tags\": [\n \"tag1\",\n \"tag2:val2\"\n ]\n }\n ]\n }\n }\n}" + } + ], + "step": "there is a valid \"confluent_account\" in the system", + "key": "confluent_account", + "tag": "Confluent Cloud Accounts API", + "operationId": "ConfluentCloudPublic3" + }, { "parameters": [ { diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 97b84af6f7..c06b747f9f 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -256,6 +256,73 @@ "type": "idempotent" } }, + "ConfluentCloudPublic1": { + "tag": "Confluent Cloud Accounts API", + "undo": { + "type": "safe" + } + }, + "ConfluentCloudPublic3": { + "tag": "Confluent Cloud Accounts API", + "undo": { + "operationId": "ConfluentCloudPublic10", + "parameters": [ + { + "name": "account_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ConfluentCloudPublic5": { + "tag": "Confluent Cloud Accounts API", + "undo": { + "type": "safe" + } + }, + "ConfluentCloudPublic2": { + "tag": "Confluent Cloud Accounts API", + "undo": { + "type": "safe" + } + }, + "ConfluentCloudPublic4": { + "tag": "Confluent Cloud Accounts API", + "undo": { + "type": "safe" + } + }, + "ConfluentCloudPublic6": { + "tag": "Confluent Cloud Accounts API", + "undo": { + "type": "safe" + } + }, + "ConfluentCloudPublic8": { + "tag": "Confluent Cloud Accounts API", + "undo": { + "type": "safe" + } + }, + "ConfluentCloudPublic10": { + "tag": "Confluent Cloud Accounts API", + "undo": { + "type": "safe" + } + }, + "ConfluentCloudPublic7": { + "tag": "Confluent Cloud Accounts API", + "undo": { + "type": "safe" + } + }, + "ConfluentCloudPublic9": { + "tag": "Confluent Cloud Accounts API", + "undo": { + "type": "safe" + } + }, "SubmitLog": { "tag": "Logs", "undo": {