diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5808b5f796..d3f83f1743 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -305,6 +305,54 @@ components: required: false schema: type: string + CommitmentsCommitmentType: + description: Type of commitment to query. ri for Reserved Instances, sp for Savings Plans. Defaults to ri. + in: query + name: commitmentType + required: false + schema: + $ref: "#/components/schemas/CommitmentsCommitmentType" + CommitmentsEnd: + description: End of the query time range in Unix milliseconds. + example: 1696118400000 + in: query + name: end + required: true + schema: + format: int64 + type: integer + CommitmentsFilterBy: + description: Optional filter expression to narrow down results. + in: query + name: filterBy + required: false + schema: + type: string + CommitmentsProduct: + description: Cloud product identifier (for example, ec2, rds, virtualmachines). + example: ec2 + in: query + name: product + required: true + schema: + type: string + CommitmentsProvider: + description: Cloud provider for commitment programs (aws or azure). + example: aws + in: query + name: provider + required: true + schema: + $ref: "#/components/schemas/CommitmentsProvider" + CommitmentsStart: + description: Start of the query time range in Unix milliseconds. + example: 1693526400000 + in: query + name: start + required: true + schema: + format: int64 + type: integer ConfluentAccountID: description: Confluent Account ID. in: path @@ -13941,6 +13989,623 @@ components: type: string x-enum-varnames: - CI_APP_COVERAGE_COMMIT_SUMMARY_REQUEST + CommitmentsAwsEC2RICommitment: + description: AWS EC2 Reserved Instance commitment details. + properties: + availability_zone: + description: The availability zone of the reservation. + example: us-east-1a + type: string + commitment_id: + description: The unique identifier of the Reserved Instance. + example: ri-0123456789abcdef0 + type: string + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + instance_type: + description: The EC2 instance type. + example: m5.xlarge + type: string + number_of_nfus: + description: The number of Normalized Capacity Units. + example: 8 + format: double + type: number + number_of_reservations: + description: The number of reserved instances. + example: 2 + format: double + type: number + offering_class: + description: The offering class of the Reserved Instance. + example: standard + type: string + operating_system: + description: The operating system of the Reserved Instance. + example: Linux + type: string + purchase_option: + description: The payment option for the Reserved Instance. + example: All Upfront + type: string + region: + description: The AWS region of the Reserved Instance. + example: us-east-1 + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - commitment_id + - instance_type + - offering_class + - operating_system + - purchase_option + - region + type: object + CommitmentsAwsElasticacheRICommitment: + description: AWS ElastiCache Reserved Instance commitment details. + properties: + cache_engine: + description: The cache engine type of the Reserved Instance. + example: Redis + type: string + commitment_id: + description: The unique identifier of the Reserved Instance. + example: ri-0123456789abcdef0 + type: string + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + instance_type: + description: The ElastiCache instance type. + example: cache.m5.xlarge + type: string + number_of_nfus: + description: The number of Normalized Capacity Units. + example: 8 + format: double + type: number + number_of_reservations: + description: The number of reserved instances. + example: 2 + format: double + type: number + purchase_option: + description: The payment option for the Reserved Instance. + example: All Upfront + type: string + region: + description: The AWS region of the Reserved Instance. + example: us-east-1 + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - cache_engine + - commitment_id + - instance_type + - purchase_option + - region + type: object + CommitmentsAwsRDSRICommitment: + description: AWS RDS Reserved Instance commitment details. + properties: + commitment_id: + description: The unique identifier of the Reserved Instance. + example: ri-0123456789abcdef0 + type: string + database_engine: + description: The database engine of the Reserved Instance. + example: MySQL + type: string + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + instance_type: + description: The RDS instance type. + example: db.m5.xlarge + type: string + is_multi_az: + description: Whether the Reserved Instance is Multi-AZ. + example: false + type: boolean + number_of_nfus: + description: The number of Normalized Capacity Units. + example: 8 + format: double + type: number + number_of_reservations: + description: The number of reserved instances. + example: 2 + format: double + type: number + purchase_option: + description: The payment option for the Reserved Instance. + example: All Upfront + type: string + region: + description: The AWS region of the Reserved Instance. + example: us-east-1 + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - commitment_id + - database_engine + - instance_type + - purchase_option + - region + type: object + CommitmentsAwsSPCommitment: + description: AWS Savings Plan commitment details. + properties: + commitment_id: + description: The unique identifier of the Savings Plan. + example: arn:aws:savingsplans::123456789:savingsplan/abc123 + type: string + committed_spend_per_hour: + description: The hourly committed spend for the Savings Plan. + example: 1.5 + format: double + type: number + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + purchase_option: + description: The payment option for the Savings Plan. + example: All Upfront + type: string + savings_plan_type: + description: The Savings Plan type. + example: ComputeSavingsPlans + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - commitment_id + - purchase_option + - savings_plan_type + type: object + CommitmentsAzureComputeSPCommitment: + description: Azure Compute Savings Plan commitment details. + properties: + benefit_name: + description: The display name of the Azure Savings Plan. + example: my-compute-savings-plan + type: string + commitment_id: + description: The unique identifier of the Savings Plan. + example: /subscriptions/abc123/providers/Microsoft.BillingBenefits/savingsPlanOrders/xyz789 + type: string + committed_spend_per_hour: + description: The hourly committed spend for the Savings Plan. + example: 2.5 + format: double + type: number + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - benefit_name + - commitment_id + type: object + CommitmentsAzureVMRICommitment: + description: Azure Virtual Machine Reserved Instance commitment details. + properties: + benefit_name: + description: The display name of the Azure reservation. + example: my-vm-reservation + type: string + commitment_id: + description: The unique identifier of the Reserved Instance. + example: /subscriptions/abc123/providers/Microsoft.Capacity/reservationOrders/xyz789 + type: string + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + instance_type: + description: The Azure VM instance type. + example: Standard_D4s_v3 + type: string + meter_sub_category: + description: The Azure meter sub-category for the reservation. + example: D4s v3 + type: string + region: + description: The Azure region of the Reserved Instance. + example: eastus + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + status: + $ref: "#/components/schemas/CommitmentsAzureVMRIStatus" + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - benefit_name + - commitment_id + - instance_type + - meter_sub_category + - region + - status + type: object + CommitmentsAzureVMRIStatus: + description: Status of an Azure VM Reserved Instance. + enum: + - running + - expired + - cancelled + example: running + type: string + x-enum-varnames: + - RUNNING + - EXPIRED + - CANCELLED + CommitmentsCommitmentType: + description: Type of commitment. ri for Reserved Instances, sp for Savings Plans. + enum: + - ri + - sp + example: ri + type: string + x-enum-varnames: + - RESERVED_INSTANCES + - SAVINGS_PLANS + CommitmentsCoverageScalarResponse: + description: Response containing scalar coverage metrics for cloud commitment programs. + properties: + columns: + $ref: "#/components/schemas/CommitmentsScalarColumns" + required: + - columns + type: object + CommitmentsCoverageTimeseriesResponse: + description: Response containing timeseries coverage metrics for cloud commitment programs. + properties: + cost: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + hours: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + required: + - cost + - hours + type: object + CommitmentsListItem: + description: A commitment item, which varies based on the provider, product, and commitment type. + oneOf: + - $ref: "#/components/schemas/CommitmentsAwsEC2RICommitment" + - $ref: "#/components/schemas/CommitmentsAwsRDSRICommitment" + - $ref: "#/components/schemas/CommitmentsAwsElasticacheRICommitment" + - $ref: "#/components/schemas/CommitmentsAwsSPCommitment" + - $ref: "#/components/schemas/CommitmentsAzureVMRICommitment" + - $ref: "#/components/schemas/CommitmentsAzureComputeSPCommitment" + CommitmentsListItems: + description: Array of commitment items. + example: + - commitment_id: ri-0123456789abcdef0 + instance_type: m5.xlarge + offering_class: standard + operating_system: Linux + purchase_option: All Upfront + region: us-east-1 + items: + $ref: "#/components/schemas/CommitmentsListItem" + type: array + CommitmentsListMeta: + description: Metadata for a commitments list response. + properties: + committed_spend_unit: + $ref: "#/components/schemas/CommitmentsUnit" + type: object + CommitmentsListResponse: + description: Response containing a list of cloud commitment details. + properties: + commitments: + $ref: "#/components/schemas/CommitmentsListItems" + meta: + $ref: "#/components/schemas/CommitmentsListMeta" + required: + - commitments + type: object + CommitmentsOnDemandHotspotsScalarMeta: + description: Metadata for the on-demand hot-spots scalar response. + properties: + on_demand_filters: + description: Active on-demand filters applied to the response. + example: "region:us-east-1" + type: string + required: + - on_demand_filters + type: object + CommitmentsOnDemandHotspotsScalarResponse: + description: Response containing scalar on-demand hot-spots data for cloud commitment programs. + properties: + columns: + $ref: "#/components/schemas/CommitmentsScalarColumns" + meta: + $ref: "#/components/schemas/CommitmentsOnDemandHotspotsScalarMeta" + total: + $ref: "#/components/schemas/CommitmentsScalarColumns" + required: + - columns + - total + type: object + CommitmentsProvider: + description: Cloud provider for commitment programs. + enum: + - aws + - azure + example: aws + type: string + x-enum-varnames: + - AWS + - AZURE + CommitmentsSavingsScalarResponse: + description: Response containing scalar savings metrics for cloud commitment programs. + properties: + columns: + $ref: "#/components/schemas/CommitmentsScalarColumns" + required: + - columns + type: object + CommitmentsSavingsTimeseriesResponse: + description: Response containing timeseries savings metrics for cloud commitment programs. + properties: + actual_cost: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + effective_savings_rate: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + on_demand_equivalent_cost: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + realized_savings: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + required: + - actual_cost + - effective_savings_rate + - on_demand_equivalent_cost + - realized_savings + type: object + CommitmentsScalarColumn: + description: A column in a scalar response. When type is "group", values contains arrays of strings. When type is "number", values contains numeric values. + properties: + meta: + $ref: "#/components/schemas/CommitmentsScalarColumnMeta" + name: + description: The column name. + example: utilization + type: string + type: + $ref: "#/components/schemas/CommitmentsScalarColumnType" + values: + $ref: "#/components/schemas/CommitmentsScalarColumnValueItems" + required: + - name + - type + - values + type: object + CommitmentsScalarColumnMeta: + description: Metadata for a scalar column, including unit information. + properties: + unit: + $ref: "#/components/schemas/CommitmentsUnit" + required: + - unit + type: object + CommitmentsScalarColumnType: + description: The column type. "group" for dimension columns, "number" for metric columns. + enum: + - group + - number + example: group + type: string + x-enum-varnames: + - GROUP + - NUMBER + CommitmentsScalarColumnValueItems: + description: Values for a scalar column. Arrays of strings for group columns, numbers for value columns. + example: + - 0.85 + - 0.72 + items: {} + type: array + CommitmentsScalarColumns: + description: Array of scalar columns in the response. + items: + $ref: "#/components/schemas/CommitmentsScalarColumn" + type: array + CommitmentsTimeseriesMetric: + description: A timeseries metric containing timestamps, series values, and optional unit metadata. + properties: + series: + $ref: "#/components/schemas/CommitmentsTimeseriesSeries" + times: + $ref: "#/components/schemas/CommitmentsTimestamps" + unit: + $ref: "#/components/schemas/CommitmentsUnit" + required: + - series + - times + type: object + CommitmentsTimeseriesSeries: + additionalProperties: + $ref: "#/components/schemas/CommitmentsTimeseriesValues" + description: Timeseries data as a map of series names to their corresponding value arrays. + type: object + CommitmentsTimeseriesValues: + description: A series of numeric values for a timeseries metric. + items: + format: double + type: number + type: array + CommitmentsTimestamps: + description: Unix timestamps in seconds for the timeseries data points. + example: + - 1693526400 + - 1693612800 + items: + format: int64 + type: integer + type: array + CommitmentsUnit: + description: Unit metadata for a numeric metric. + properties: + family: + description: The unit family (for example, percentage or money). + example: percentage + type: string + id: + description: The unit identifier. + example: 17 + format: int64 + type: integer + name: + description: The unit name (for example, percent or dollar). + example: percent + type: string + plural: + description: The plural form of the unit name. + example: percent + type: string + scale_factor: + description: The scale factor for the unit. + example: 1 + format: double + type: number + short_name: + description: The abbreviated unit name (for example, % or $). + example: "%" + type: string + required: + - family + - id + - name + - plural + - scale_factor + - short_name + type: object + CommitmentsUtilizationScalarProductBreakdown: + description: Array of per-product utilization breakdown entries. + items: + $ref: "#/components/schemas/CommitmentsUtilizationScalarProductBreakdownEntry" + type: array + CommitmentsUtilizationScalarProductBreakdownEntry: + description: Per-product utilization data in a scalar utilization response. + properties: + product: + description: The cloud product name. + example: ec2 + type: string + utilization: + description: The utilization percentage for the product. + example: 0.85 + format: double + type: number + required: + - product + - utilization + type: object + CommitmentsUtilizationScalarResponse: + description: Response containing scalar utilization metrics for cloud commitment programs. + properties: + columns: + $ref: "#/components/schemas/CommitmentsScalarColumns" + product_breakdown: + $ref: "#/components/schemas/CommitmentsUtilizationScalarProductBreakdown" + required: + - columns + type: object + CommitmentsUtilizationTimeseriesResponse: + description: Response containing timeseries utilization metrics for cloud commitment programs. + properties: + series: + $ref: "#/components/schemas/CommitmentsTimeseriesSeries" + times: + $ref: "#/components/schemas/CommitmentsTimestamps" + unit: + $ref: "#/components/schemas/CommitmentsUnit" + required: + - series + - times + type: object CompletionCondition: description: The definition of `CompletionCondition` object. properties: @@ -96588,6 +97253,545 @@ paths: summary: List budgets tags: - Cloud Cost Management + /api/v2/cost/commitments/commitment-list: + get: + description: Get a list of individual cloud commitments (Reserved Instances or Savings Plans) with their utilization details. The response schema varies based on the provider, product, and commitment type. + operationId: GetCommitmentsCommitmentList + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + - $ref: "#/components/parameters/CommitmentsCommitmentType" + responses: + "200": + content: + application/json: + examples: + default: + value: + commitments: + - commitment_id: ri-0123456789abcdef0 + expiration_date: "2025-12-31T00:00:00Z" + instance_type: m5.xlarge + offering_class: standard + operating_system: Linux + purchase_option: All Upfront + region: us-east-1 + start_date: "2023-01-01T00:00:00Z" + term_length: 1 + utilization: 0.85 + schema: + $ref: "#/components/schemas/CommitmentsListResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments list + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/coverage/scalar: + get: + description: Get scalar coverage metrics for cloud commitment programs, including hours and cost coverage percentages. + operationId: GetCommitmentsCoverageScalar + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + columns: + - name: service + type: group + values: + - - ec2 + - meta: + unit: + family: percentage + id: 17 + name: percent + plural: percent + scale_factor: 1 + short_name: "%" + name: hours_coverage + type: number + values: + - 0.78 + schema: + $ref: "#/components/schemas/CommitmentsCoverageScalarResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments coverage (scalar) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/coverage/timeseries: + get: + description: Get timeseries coverage metrics for cloud commitment programs, broken down by coverage type (Reserved Instances, Savings Plans, On-Demand, and Spot) for both hours and cost. + operationId: GetCommitmentsCoverageTimeseries + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + cost: + series: + on_demand_only: + - 1000.0 + - 900.0 + ri: + - 3600.0 + - 3700.0 + sp: + - 400.0 + - 400.0 + spot_only: + - 50.0 + - 50.0 + times: + - 1693526400 + - 1693612800 + hours: + series: + on_demand_only: + - 500.0 + - 450.0 + ri: + - 1800.0 + - 1850.0 + sp: + - 200.0 + - 200.0 + spot_only: + - 100.0 + - 100.0 + times: + - 1693526400 + - 1693612800 + schema: + $ref: "#/components/schemas/CommitmentsCoverageTimeseriesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments coverage (timeseries) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/on-demand-hot-spots/scalar: + get: + description: Get scalar on-demand hot-spots data for cloud commitment programs, showing per-dimension breakdowns of on-demand spending with coverage metrics and potential savings. + operationId: GetCommitmentsOnDemandHotspotsScalar + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + columns: + - name: service + type: group + values: + - - ec2 + - meta: + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + name: on_demand_cost + type: number + values: + - 1500.0 + total: + - meta: + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + name: on_demand_cost + type: number + values: + - 1500.0 + schema: + $ref: "#/components/schemas/CommitmentsOnDemandHotspotsScalarResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments on-demand hot spots (scalar) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/savings/scalar: + get: + description: Get scalar savings metrics for cloud commitment programs, including realized savings and effective savings rate. + operationId: GetCommitmentsSavingsScalar + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + columns: + - meta: + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + name: realized_savings + type: number + values: + - 2500.0 + - meta: + unit: + family: percentage + id: 17 + name: percent + plural: percent + scale_factor: 1 + short_name: "%" + name: effective_savings_rate + type: number + values: + - 0.33 + schema: + $ref: "#/components/schemas/CommitmentsSavingsScalarResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments savings (scalar) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/savings/timeseries: + get: + description: Get timeseries savings metrics for cloud commitment programs, including actual cost, on-demand equivalent cost, realized savings, and effective savings rate over time. + operationId: GetCommitmentsSavingsTimeseries + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + actual_cost: + series: + total: + - 5000.0 + - 5200.0 + times: + - 1693526400 + - 1693612800 + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + effective_savings_rate: + series: + total: + - 0.33 + - 0.33 + times: + - 1693526400 + - 1693612800 + on_demand_equivalent_cost: + series: + total: + - 7500.0 + - 7800.0 + times: + - 1693526400 + - 1693612800 + realized_savings: + series: + total: + - 2500.0 + - 2600.0 + times: + - 1693526400 + - 1693612800 + schema: + $ref: "#/components/schemas/CommitmentsSavingsTimeseriesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments savings (timeseries) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/utilization/scalar: + get: + description: Get scalar utilization metrics for cloud commitment programs, including utilization percentage and unused cost. + operationId: GetCommitmentsUtilizationScalar + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + - $ref: "#/components/parameters/CommitmentsCommitmentType" + responses: + "200": + content: + application/json: + examples: + default: + value: + columns: + - name: service + type: group + values: + - - ec2 + - - rds + - meta: + unit: + family: percentage + id: 17 + name: percent + plural: percent + scale_factor: 1 + short_name: "%" + name: utilization + type: number + values: + - 0.85 + - 0.72 + schema: + $ref: "#/components/schemas/CommitmentsUtilizationScalarResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments utilization (scalar) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/utilization/timeseries: + get: + description: Get timeseries utilization metrics for cloud commitment programs, including used and unused cost series over time. + operationId: GetCommitmentsUtilizationTimeseries + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + - $ref: "#/components/parameters/CommitmentsCommitmentType" + responses: + "200": + content: + application/json: + examples: + default: + value: + series: + unused: + - 750.0 + - 600.0 + used: + - 4250.0 + - 4400.0 + times: + - 1693526400 + - 1693612800 + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + schema: + $ref: "#/components/schemas/CommitmentsUtilizationTimeseriesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments utilization (timeseries) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/cost/custom_costs: get: description: List the Custom Costs files. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 406433db99..c6ed3f8d5f 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -5478,6 +5478,195 @@ datadog\_api\_client.v2.model.commit\_coverage\_summary\_request\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.commitments\_aws\_ec2\_ri\_commitment module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_aws_ec2_ri_commitment + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_aws\_elasticache\_ri\_commitment module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_aws_elasticache_ri_commitment + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_aws\_rdsri\_commitment module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.commitments_aws_rdsri_commitment + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_aws\_sp\_commitment module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_aws_sp_commitment + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_azure\_compute\_sp\_commitment module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_azure_compute_sp_commitment + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_azure\_vmri\_commitment module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_azure_vmri_commitment + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_azure\_vmri\_status module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_azure_vmri_status + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_commitment\_type module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.commitments_commitment_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_coverage\_scalar\_response module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_coverage_scalar_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_coverage\_timeseries\_response module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_coverage_timeseries_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_list\_item module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.commitments_list_item + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_list\_meta module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.commitments_list_meta + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_list\_response module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_list_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_on\_demand\_hotspots\_scalar\_meta module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.commitments_on_demand_hotspots_scalar_meta + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_on\_demand\_hotspots\_scalar\_response module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_on_demand_hotspots_scalar_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_provider module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_provider + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_savings\_scalar\_response module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_savings_scalar_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_savings\_timeseries\_response module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_savings_timeseries_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_scalar\_column module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_scalar_column + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_scalar\_column\_meta module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_scalar_column_meta + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_scalar\_column\_type module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_scalar_column_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_timeseries\_metric module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_timeseries_metric + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_timeseries\_series module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_timeseries_series + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_unit module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.commitments_unit + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_utilization\_scalar\_product\_breakdown\_entry module +------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.commitments_utilization_scalar_product_breakdown_entry + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_utilization\_scalar\_response module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_utilization_scalar_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.commitments\_utilization\_timeseries\_response module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.commitments_utilization_timeseries_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.completion\_condition module ---------------------------------------------------------- diff --git a/examples/v2/cloud-cost-management/GetCommitmentsCommitmentList.py b/examples/v2/cloud-cost-management/GetCommitmentsCommitmentList.py new file mode 100644 index 0000000000..ceae30dfc2 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsCommitmentList.py @@ -0,0 +1,20 @@ +""" +Get commitments list returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi +from datadog_api_client.v2.model.commitments_provider import CommitmentsProvider + +configuration = Configuration() +configuration.unstable_operations["get_commitments_commitment_list"] = True +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.get_commitments_commitment_list( + provider=CommitmentsProvider.AWS, + product="product", + start=9223372036854775807, + end=9223372036854775807, + ) + + print(response) diff --git a/examples/v2/cloud-cost-management/GetCommitmentsCoverageScalar.py b/examples/v2/cloud-cost-management/GetCommitmentsCoverageScalar.py new file mode 100644 index 0000000000..93bdd2b411 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsCoverageScalar.py @@ -0,0 +1,20 @@ +""" +Get commitments coverage (scalar) returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi +from datadog_api_client.v2.model.commitments_provider import CommitmentsProvider + +configuration = Configuration() +configuration.unstable_operations["get_commitments_coverage_scalar"] = True +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.get_commitments_coverage_scalar( + provider=CommitmentsProvider.AWS, + product="product", + start=9223372036854775807, + end=9223372036854775807, + ) + + print(response) diff --git a/examples/v2/cloud-cost-management/GetCommitmentsCoverageTimeseries.py b/examples/v2/cloud-cost-management/GetCommitmentsCoverageTimeseries.py new file mode 100644 index 0000000000..2074907306 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsCoverageTimeseries.py @@ -0,0 +1,20 @@ +""" +Get commitments coverage (timeseries) returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi +from datadog_api_client.v2.model.commitments_provider import CommitmentsProvider + +configuration = Configuration() +configuration.unstable_operations["get_commitments_coverage_timeseries"] = True +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.get_commitments_coverage_timeseries( + provider=CommitmentsProvider.AWS, + product="product", + start=9223372036854775807, + end=9223372036854775807, + ) + + print(response) diff --git a/examples/v2/cloud-cost-management/GetCommitmentsOnDemandHotspotsScalar.py b/examples/v2/cloud-cost-management/GetCommitmentsOnDemandHotspotsScalar.py new file mode 100644 index 0000000000..0902e53fa7 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsOnDemandHotspotsScalar.py @@ -0,0 +1,20 @@ +""" +Get commitments on-demand hot spots (scalar) returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi +from datadog_api_client.v2.model.commitments_provider import CommitmentsProvider + +configuration = Configuration() +configuration.unstable_operations["get_commitments_on_demand_hotspots_scalar"] = True +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.get_commitments_on_demand_hotspots_scalar( + provider=CommitmentsProvider.AWS, + product="product", + start=9223372036854775807, + end=9223372036854775807, + ) + + print(response) diff --git a/examples/v2/cloud-cost-management/GetCommitmentsSavingsScalar.py b/examples/v2/cloud-cost-management/GetCommitmentsSavingsScalar.py new file mode 100644 index 0000000000..fbf9889e34 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsSavingsScalar.py @@ -0,0 +1,20 @@ +""" +Get commitments savings (scalar) returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi +from datadog_api_client.v2.model.commitments_provider import CommitmentsProvider + +configuration = Configuration() +configuration.unstable_operations["get_commitments_savings_scalar"] = True +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.get_commitments_savings_scalar( + provider=CommitmentsProvider.AWS, + product="product", + start=9223372036854775807, + end=9223372036854775807, + ) + + print(response) diff --git a/examples/v2/cloud-cost-management/GetCommitmentsSavingsTimeseries.py b/examples/v2/cloud-cost-management/GetCommitmentsSavingsTimeseries.py new file mode 100644 index 0000000000..55129447f9 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsSavingsTimeseries.py @@ -0,0 +1,20 @@ +""" +Get commitments savings (timeseries) returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi +from datadog_api_client.v2.model.commitments_provider import CommitmentsProvider + +configuration = Configuration() +configuration.unstable_operations["get_commitments_savings_timeseries"] = True +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.get_commitments_savings_timeseries( + provider=CommitmentsProvider.AWS, + product="product", + start=9223372036854775807, + end=9223372036854775807, + ) + + print(response) diff --git a/examples/v2/cloud-cost-management/GetCommitmentsUtilizationScalar.py b/examples/v2/cloud-cost-management/GetCommitmentsUtilizationScalar.py new file mode 100644 index 0000000000..fe95b651fa --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsUtilizationScalar.py @@ -0,0 +1,20 @@ +""" +Get commitments utilization (scalar) returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi +from datadog_api_client.v2.model.commitments_provider import CommitmentsProvider + +configuration = Configuration() +configuration.unstable_operations["get_commitments_utilization_scalar"] = True +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.get_commitments_utilization_scalar( + provider=CommitmentsProvider.AWS, + product="product", + start=9223372036854775807, + end=9223372036854775807, + ) + + print(response) diff --git a/examples/v2/cloud-cost-management/GetCommitmentsUtilizationTimeseries.py b/examples/v2/cloud-cost-management/GetCommitmentsUtilizationTimeseries.py new file mode 100644 index 0000000000..ff967df325 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsUtilizationTimeseries.py @@ -0,0 +1,20 @@ +""" +Get commitments utilization (timeseries) returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi +from datadog_api_client.v2.model.commitments_provider import CommitmentsProvider + +configuration = Configuration() +configuration.unstable_operations["get_commitments_utilization_timeseries"] = True +with ApiClient(configuration) as api_client: + api_instance = CloudCostManagementApi(api_client) + response = api_instance.get_commitments_utilization_timeseries( + provider=CommitmentsProvider.AWS, + product="product", + start=9223372036854775807, + end=9223372036854775807, + ) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 7bede2f3eb..8eb34d4bc5 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -351,6 +351,14 @@ def __init__( "v2.search_security_monitoring_histsignals": False, "v2.get_code_coverage_branch_summary": False, "v2.get_code_coverage_commit_summary": False, + "v2.get_commitments_commitment_list": False, + "v2.get_commitments_coverage_scalar": False, + "v2.get_commitments_coverage_timeseries": False, + "v2.get_commitments_on_demand_hotspots_scalar": False, + "v2.get_commitments_savings_scalar": False, + "v2.get_commitments_savings_timeseries": False, + "v2.get_commitments_utilization_scalar": False, + "v2.get_commitments_utilization_timeseries": False, "v2.create_dashboard_secure_embed": False, "v2.delete_dashboard_secure_embed": False, "v2.get_dashboard_secure_embed": False, diff --git a/src/datadog_api_client/v2/api/cloud_cost_management_api.py b/src/datadog_api_client/v2/api/cloud_cost_management_api.py index 1c66232eae..962f2155e0 100644 --- a/src/datadog_api_client/v2/api/cloud_cost_management_api.py +++ b/src/datadog_api_client/v2/api/cloud_cost_management_api.py @@ -30,6 +30,20 @@ from datadog_api_client.v2.model.budget_validation_response import BudgetValidationResponse from datadog_api_client.v2.model.budget_validation_request import BudgetValidationRequest from datadog_api_client.v2.model.budget_array import BudgetArray +from datadog_api_client.v2.model.commitments_list_response import CommitmentsListResponse +from datadog_api_client.v2.model.commitments_provider import CommitmentsProvider +from datadog_api_client.v2.model.commitments_commitment_type import CommitmentsCommitmentType +from datadog_api_client.v2.model.commitments_coverage_scalar_response import CommitmentsCoverageScalarResponse +from datadog_api_client.v2.model.commitments_coverage_timeseries_response import CommitmentsCoverageTimeseriesResponse +from datadog_api_client.v2.model.commitments_on_demand_hotspots_scalar_response import ( + CommitmentsOnDemandHotspotsScalarResponse, +) +from datadog_api_client.v2.model.commitments_savings_scalar_response import CommitmentsSavingsScalarResponse +from datadog_api_client.v2.model.commitments_savings_timeseries_response import CommitmentsSavingsTimeseriesResponse +from datadog_api_client.v2.model.commitments_utilization_scalar_response import CommitmentsUtilizationScalarResponse +from datadog_api_client.v2.model.commitments_utilization_timeseries_response import ( + CommitmentsUtilizationTimeseriesResponse, +) from datadog_api_client.v2.model.custom_costs_file_list_response import CustomCostsFileListResponse from datadog_api_client.v2.model.custom_costs_file_upload_response import CustomCostsFileUploadResponse from datadog_api_client.v2.model.custom_costs_file_line_item import CustomCostsFileLineItem @@ -345,6 +359,389 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_commitments_commitment_list_endpoint = _Endpoint( + settings={ + "response_type": (CommitmentsListResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cost/commitments/commitment-list", + "operation_id": "get_commitments_commitment_list", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "provider": { + "required": True, + "openapi_types": (CommitmentsProvider,), + "attribute": "provider", + "location": "query", + }, + "product": { + "required": True, + "openapi_types": (str,), + "attribute": "product", + "location": "query", + }, + "start": { + "required": True, + "openapi_types": (int,), + "attribute": "start", + "location": "query", + }, + "end": { + "required": True, + "openapi_types": (int,), + "attribute": "end", + "location": "query", + }, + "filter_by": { + "openapi_types": (str,), + "attribute": "filterBy", + "location": "query", + }, + "commitment_type": { + "openapi_types": (CommitmentsCommitmentType,), + "attribute": "commitmentType", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_commitments_coverage_scalar_endpoint = _Endpoint( + settings={ + "response_type": (CommitmentsCoverageScalarResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cost/commitments/coverage/scalar", + "operation_id": "get_commitments_coverage_scalar", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "provider": { + "required": True, + "openapi_types": (CommitmentsProvider,), + "attribute": "provider", + "location": "query", + }, + "product": { + "required": True, + "openapi_types": (str,), + "attribute": "product", + "location": "query", + }, + "start": { + "required": True, + "openapi_types": (int,), + "attribute": "start", + "location": "query", + }, + "end": { + "required": True, + "openapi_types": (int,), + "attribute": "end", + "location": "query", + }, + "filter_by": { + "openapi_types": (str,), + "attribute": "filterBy", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_commitments_coverage_timeseries_endpoint = _Endpoint( + settings={ + "response_type": (CommitmentsCoverageTimeseriesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cost/commitments/coverage/timeseries", + "operation_id": "get_commitments_coverage_timeseries", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "provider": { + "required": True, + "openapi_types": (CommitmentsProvider,), + "attribute": "provider", + "location": "query", + }, + "product": { + "required": True, + "openapi_types": (str,), + "attribute": "product", + "location": "query", + }, + "start": { + "required": True, + "openapi_types": (int,), + "attribute": "start", + "location": "query", + }, + "end": { + "required": True, + "openapi_types": (int,), + "attribute": "end", + "location": "query", + }, + "filter_by": { + "openapi_types": (str,), + "attribute": "filterBy", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_commitments_on_demand_hotspots_scalar_endpoint = _Endpoint( + settings={ + "response_type": (CommitmentsOnDemandHotspotsScalarResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cost/commitments/on-demand-hot-spots/scalar", + "operation_id": "get_commitments_on_demand_hotspots_scalar", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "provider": { + "required": True, + "openapi_types": (CommitmentsProvider,), + "attribute": "provider", + "location": "query", + }, + "product": { + "required": True, + "openapi_types": (str,), + "attribute": "product", + "location": "query", + }, + "start": { + "required": True, + "openapi_types": (int,), + "attribute": "start", + "location": "query", + }, + "end": { + "required": True, + "openapi_types": (int,), + "attribute": "end", + "location": "query", + }, + "filter_by": { + "openapi_types": (str,), + "attribute": "filterBy", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_commitments_savings_scalar_endpoint = _Endpoint( + settings={ + "response_type": (CommitmentsSavingsScalarResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cost/commitments/savings/scalar", + "operation_id": "get_commitments_savings_scalar", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "provider": { + "required": True, + "openapi_types": (CommitmentsProvider,), + "attribute": "provider", + "location": "query", + }, + "product": { + "required": True, + "openapi_types": (str,), + "attribute": "product", + "location": "query", + }, + "start": { + "required": True, + "openapi_types": (int,), + "attribute": "start", + "location": "query", + }, + "end": { + "required": True, + "openapi_types": (int,), + "attribute": "end", + "location": "query", + }, + "filter_by": { + "openapi_types": (str,), + "attribute": "filterBy", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_commitments_savings_timeseries_endpoint = _Endpoint( + settings={ + "response_type": (CommitmentsSavingsTimeseriesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cost/commitments/savings/timeseries", + "operation_id": "get_commitments_savings_timeseries", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "provider": { + "required": True, + "openapi_types": (CommitmentsProvider,), + "attribute": "provider", + "location": "query", + }, + "product": { + "required": True, + "openapi_types": (str,), + "attribute": "product", + "location": "query", + }, + "start": { + "required": True, + "openapi_types": (int,), + "attribute": "start", + "location": "query", + }, + "end": { + "required": True, + "openapi_types": (int,), + "attribute": "end", + "location": "query", + }, + "filter_by": { + "openapi_types": (str,), + "attribute": "filterBy", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_commitments_utilization_scalar_endpoint = _Endpoint( + settings={ + "response_type": (CommitmentsUtilizationScalarResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cost/commitments/utilization/scalar", + "operation_id": "get_commitments_utilization_scalar", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "provider": { + "required": True, + "openapi_types": (CommitmentsProvider,), + "attribute": "provider", + "location": "query", + }, + "product": { + "required": True, + "openapi_types": (str,), + "attribute": "product", + "location": "query", + }, + "start": { + "required": True, + "openapi_types": (int,), + "attribute": "start", + "location": "query", + }, + "end": { + "required": True, + "openapi_types": (int,), + "attribute": "end", + "location": "query", + }, + "filter_by": { + "openapi_types": (str,), + "attribute": "filterBy", + "location": "query", + }, + "commitment_type": { + "openapi_types": (CommitmentsCommitmentType,), + "attribute": "commitmentType", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_commitments_utilization_timeseries_endpoint = _Endpoint( + settings={ + "response_type": (CommitmentsUtilizationTimeseriesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/cost/commitments/utilization/timeseries", + "operation_id": "get_commitments_utilization_timeseries", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "provider": { + "required": True, + "openapi_types": (CommitmentsProvider,), + "attribute": "provider", + "location": "query", + }, + "product": { + "required": True, + "openapi_types": (str,), + "attribute": "product", + "location": "query", + }, + "start": { + "required": True, + "openapi_types": (int,), + "attribute": "start", + "location": "query", + }, + "end": { + "required": True, + "openapi_types": (int,), + "attribute": "end", + "location": "query", + }, + "filter_by": { + "openapi_types": (str,), + "attribute": "filterBy", + "location": "query", + }, + "commitment_type": { + "openapi_types": (CommitmentsCommitmentType,), + "attribute": "commitmentType", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_cost_awscur_config_endpoint = _Endpoint( settings={ "response_type": (AwsCurConfigResponse,), @@ -1194,6 +1591,336 @@ def get_budget( return self._get_budget_endpoint.call_with_http_info(**kwargs) + def get_commitments_commitment_list( + self, + provider: CommitmentsProvider, + product: str, + start: int, + end: int, + *, + filter_by: Union[str, UnsetType] = unset, + commitment_type: Union[CommitmentsCommitmentType, UnsetType] = unset, + ) -> CommitmentsListResponse: + """Get commitments list. + + Get a list of individual cloud commitments (Reserved Instances or Savings Plans) with their utilization details. The response schema varies based on the provider, product, and commitment type. + + :param provider: Cloud provider for commitment programs (aws or azure). + :type provider: CommitmentsProvider + :param product: Cloud product identifier (for example, ec2, rds, virtualmachines). + :type product: str + :param start: Start of the query time range in Unix milliseconds. + :type start: int + :param end: End of the query time range in Unix milliseconds. + :type end: int + :param filter_by: Optional filter expression to narrow down results. + :type filter_by: str, optional + :param commitment_type: Type of commitment to query. ri for Reserved Instances, sp for Savings Plans. Defaults to ri. + :type commitment_type: CommitmentsCommitmentType, optional + :rtype: CommitmentsListResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["provider"] = provider + + kwargs["product"] = product + + kwargs["start"] = start + + kwargs["end"] = end + + if filter_by is not unset: + kwargs["filter_by"] = filter_by + + if commitment_type is not unset: + kwargs["commitment_type"] = commitment_type + + return self._get_commitments_commitment_list_endpoint.call_with_http_info(**kwargs) + + def get_commitments_coverage_scalar( + self, + provider: CommitmentsProvider, + product: str, + start: int, + end: int, + *, + filter_by: Union[str, UnsetType] = unset, + ) -> CommitmentsCoverageScalarResponse: + """Get commitments coverage (scalar). + + Get scalar coverage metrics for cloud commitment programs, including hours and cost coverage percentages. + + :param provider: Cloud provider for commitment programs (aws or azure). + :type provider: CommitmentsProvider + :param product: Cloud product identifier (for example, ec2, rds, virtualmachines). + :type product: str + :param start: Start of the query time range in Unix milliseconds. + :type start: int + :param end: End of the query time range in Unix milliseconds. + :type end: int + :param filter_by: Optional filter expression to narrow down results. + :type filter_by: str, optional + :rtype: CommitmentsCoverageScalarResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["provider"] = provider + + kwargs["product"] = product + + kwargs["start"] = start + + kwargs["end"] = end + + if filter_by is not unset: + kwargs["filter_by"] = filter_by + + return self._get_commitments_coverage_scalar_endpoint.call_with_http_info(**kwargs) + + def get_commitments_coverage_timeseries( + self, + provider: CommitmentsProvider, + product: str, + start: int, + end: int, + *, + filter_by: Union[str, UnsetType] = unset, + ) -> CommitmentsCoverageTimeseriesResponse: + """Get commitments coverage (timeseries). + + Get timeseries coverage metrics for cloud commitment programs, broken down by coverage type (Reserved Instances, Savings Plans, On-Demand, and Spot) for both hours and cost. + + :param provider: Cloud provider for commitment programs (aws or azure). + :type provider: CommitmentsProvider + :param product: Cloud product identifier (for example, ec2, rds, virtualmachines). + :type product: str + :param start: Start of the query time range in Unix milliseconds. + :type start: int + :param end: End of the query time range in Unix milliseconds. + :type end: int + :param filter_by: Optional filter expression to narrow down results. + :type filter_by: str, optional + :rtype: CommitmentsCoverageTimeseriesResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["provider"] = provider + + kwargs["product"] = product + + kwargs["start"] = start + + kwargs["end"] = end + + if filter_by is not unset: + kwargs["filter_by"] = filter_by + + return self._get_commitments_coverage_timeseries_endpoint.call_with_http_info(**kwargs) + + def get_commitments_on_demand_hotspots_scalar( + self, + provider: CommitmentsProvider, + product: str, + start: int, + end: int, + *, + filter_by: Union[str, UnsetType] = unset, + ) -> CommitmentsOnDemandHotspotsScalarResponse: + """Get commitments on-demand hot spots (scalar). + + Get scalar on-demand hot-spots data for cloud commitment programs, showing per-dimension breakdowns of on-demand spending with coverage metrics and potential savings. + + :param provider: Cloud provider for commitment programs (aws or azure). + :type provider: CommitmentsProvider + :param product: Cloud product identifier (for example, ec2, rds, virtualmachines). + :type product: str + :param start: Start of the query time range in Unix milliseconds. + :type start: int + :param end: End of the query time range in Unix milliseconds. + :type end: int + :param filter_by: Optional filter expression to narrow down results. + :type filter_by: str, optional + :rtype: CommitmentsOnDemandHotspotsScalarResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["provider"] = provider + + kwargs["product"] = product + + kwargs["start"] = start + + kwargs["end"] = end + + if filter_by is not unset: + kwargs["filter_by"] = filter_by + + return self._get_commitments_on_demand_hotspots_scalar_endpoint.call_with_http_info(**kwargs) + + def get_commitments_savings_scalar( + self, + provider: CommitmentsProvider, + product: str, + start: int, + end: int, + *, + filter_by: Union[str, UnsetType] = unset, + ) -> CommitmentsSavingsScalarResponse: + """Get commitments savings (scalar). + + Get scalar savings metrics for cloud commitment programs, including realized savings and effective savings rate. + + :param provider: Cloud provider for commitment programs (aws or azure). + :type provider: CommitmentsProvider + :param product: Cloud product identifier (for example, ec2, rds, virtualmachines). + :type product: str + :param start: Start of the query time range in Unix milliseconds. + :type start: int + :param end: End of the query time range in Unix milliseconds. + :type end: int + :param filter_by: Optional filter expression to narrow down results. + :type filter_by: str, optional + :rtype: CommitmentsSavingsScalarResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["provider"] = provider + + kwargs["product"] = product + + kwargs["start"] = start + + kwargs["end"] = end + + if filter_by is not unset: + kwargs["filter_by"] = filter_by + + return self._get_commitments_savings_scalar_endpoint.call_with_http_info(**kwargs) + + def get_commitments_savings_timeseries( + self, + provider: CommitmentsProvider, + product: str, + start: int, + end: int, + *, + filter_by: Union[str, UnsetType] = unset, + ) -> CommitmentsSavingsTimeseriesResponse: + """Get commitments savings (timeseries). + + Get timeseries savings metrics for cloud commitment programs, including actual cost, on-demand equivalent cost, realized savings, and effective savings rate over time. + + :param provider: Cloud provider for commitment programs (aws or azure). + :type provider: CommitmentsProvider + :param product: Cloud product identifier (for example, ec2, rds, virtualmachines). + :type product: str + :param start: Start of the query time range in Unix milliseconds. + :type start: int + :param end: End of the query time range in Unix milliseconds. + :type end: int + :param filter_by: Optional filter expression to narrow down results. + :type filter_by: str, optional + :rtype: CommitmentsSavingsTimeseriesResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["provider"] = provider + + kwargs["product"] = product + + kwargs["start"] = start + + kwargs["end"] = end + + if filter_by is not unset: + kwargs["filter_by"] = filter_by + + return self._get_commitments_savings_timeseries_endpoint.call_with_http_info(**kwargs) + + def get_commitments_utilization_scalar( + self, + provider: CommitmentsProvider, + product: str, + start: int, + end: int, + *, + filter_by: Union[str, UnsetType] = unset, + commitment_type: Union[CommitmentsCommitmentType, UnsetType] = unset, + ) -> CommitmentsUtilizationScalarResponse: + """Get commitments utilization (scalar). + + Get scalar utilization metrics for cloud commitment programs, including utilization percentage and unused cost. + + :param provider: Cloud provider for commitment programs (aws or azure). + :type provider: CommitmentsProvider + :param product: Cloud product identifier (for example, ec2, rds, virtualmachines). + :type product: str + :param start: Start of the query time range in Unix milliseconds. + :type start: int + :param end: End of the query time range in Unix milliseconds. + :type end: int + :param filter_by: Optional filter expression to narrow down results. + :type filter_by: str, optional + :param commitment_type: Type of commitment to query. ri for Reserved Instances, sp for Savings Plans. Defaults to ri. + :type commitment_type: CommitmentsCommitmentType, optional + :rtype: CommitmentsUtilizationScalarResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["provider"] = provider + + kwargs["product"] = product + + kwargs["start"] = start + + kwargs["end"] = end + + if filter_by is not unset: + kwargs["filter_by"] = filter_by + + if commitment_type is not unset: + kwargs["commitment_type"] = commitment_type + + return self._get_commitments_utilization_scalar_endpoint.call_with_http_info(**kwargs) + + def get_commitments_utilization_timeseries( + self, + provider: CommitmentsProvider, + product: str, + start: int, + end: int, + *, + filter_by: Union[str, UnsetType] = unset, + commitment_type: Union[CommitmentsCommitmentType, UnsetType] = unset, + ) -> CommitmentsUtilizationTimeseriesResponse: + """Get commitments utilization (timeseries). + + Get timeseries utilization metrics for cloud commitment programs, including used and unused cost series over time. + + :param provider: Cloud provider for commitment programs (aws or azure). + :type provider: CommitmentsProvider + :param product: Cloud product identifier (for example, ec2, rds, virtualmachines). + :type product: str + :param start: Start of the query time range in Unix milliseconds. + :type start: int + :param end: End of the query time range in Unix milliseconds. + :type end: int + :param filter_by: Optional filter expression to narrow down results. + :type filter_by: str, optional + :param commitment_type: Type of commitment to query. ri for Reserved Instances, sp for Savings Plans. Defaults to ri. + :type commitment_type: CommitmentsCommitmentType, optional + :rtype: CommitmentsUtilizationTimeseriesResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["provider"] = provider + + kwargs["product"] = product + + kwargs["start"] = start + + kwargs["end"] = end + + if filter_by is not unset: + kwargs["filter_by"] = filter_by + + if commitment_type is not unset: + kwargs["commitment_type"] = commitment_type + + return self._get_commitments_utilization_timeseries_endpoint.call_with_http_info(**kwargs) + def get_cost_awscur_config( self, cloud_account_id: int, diff --git a/src/datadog_api_client/v2/model/commitments_aws_ec2_ri_commitment.py b/src/datadog_api_client/v2/model/commitments_aws_ec2_ri_commitment.py new file mode 100644 index 0000000000..5681ac42b4 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_aws_ec2_ri_commitment.py @@ -0,0 +1,131 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class CommitmentsAwsEC2RICommitment(ModelNormal): + @cached_property + def openapi_types(_): + return { + "availability_zone": (str,), + "commitment_id": (str,), + "expiration_date": (str,), + "instance_type": (str,), + "number_of_nfus": (float,), + "number_of_reservations": (float,), + "offering_class": (str,), + "operating_system": (str,), + "purchase_option": (str,), + "region": (str,), + "start_date": (str,), + "term_length": (float,), + "utilization": (float,), + } + + attribute_map = { + "availability_zone": "availability_zone", + "commitment_id": "commitment_id", + "expiration_date": "expiration_date", + "instance_type": "instance_type", + "number_of_nfus": "number_of_nfus", + "number_of_reservations": "number_of_reservations", + "offering_class": "offering_class", + "operating_system": "operating_system", + "purchase_option": "purchase_option", + "region": "region", + "start_date": "start_date", + "term_length": "term_length", + "utilization": "utilization", + } + + def __init__( + self_, + commitment_id: str, + instance_type: str, + offering_class: str, + operating_system: str, + purchase_option: str, + region: str, + availability_zone: Union[str, UnsetType] = unset, + expiration_date: Union[str, UnsetType] = unset, + number_of_nfus: Union[float, UnsetType] = unset, + number_of_reservations: Union[float, UnsetType] = unset, + start_date: Union[str, UnsetType] = unset, + term_length: Union[float, UnsetType] = unset, + utilization: Union[float, UnsetType] = unset, + **kwargs, + ): + """ + AWS EC2 Reserved Instance commitment details. + + :param availability_zone: The availability zone of the reservation. + :type availability_zone: str, optional + + :param commitment_id: The unique identifier of the Reserved Instance. + :type commitment_id: str + + :param expiration_date: The expiration date of the commitment. + :type expiration_date: str, optional + + :param instance_type: The EC2 instance type. + :type instance_type: str + + :param number_of_nfus: The number of Normalized Capacity Units. + :type number_of_nfus: float, optional + + :param number_of_reservations: The number of reserved instances. + :type number_of_reservations: float, optional + + :param offering_class: The offering class of the Reserved Instance. + :type offering_class: str + + :param operating_system: The operating system of the Reserved Instance. + :type operating_system: str + + :param purchase_option: The payment option for the Reserved Instance. + :type purchase_option: str + + :param region: The AWS region of the Reserved Instance. + :type region: str + + :param start_date: The start date of the commitment. + :type start_date: str, optional + + :param term_length: The term length in years. + :type term_length: float, optional + + :param utilization: The utilization percentage of the commitment. + :type utilization: float, optional + """ + if availability_zone is not unset: + kwargs["availability_zone"] = availability_zone + if expiration_date is not unset: + kwargs["expiration_date"] = expiration_date + if number_of_nfus is not unset: + kwargs["number_of_nfus"] = number_of_nfus + if number_of_reservations is not unset: + kwargs["number_of_reservations"] = number_of_reservations + if start_date is not unset: + kwargs["start_date"] = start_date + if term_length is not unset: + kwargs["term_length"] = term_length + if utilization is not unset: + kwargs["utilization"] = utilization + super().__init__(kwargs) + + self_.commitment_id = commitment_id + self_.instance_type = instance_type + self_.offering_class = offering_class + self_.operating_system = operating_system + self_.purchase_option = purchase_option + self_.region = region diff --git a/src/datadog_api_client/v2/model/commitments_aws_elasticache_ri_commitment.py b/src/datadog_api_client/v2/model/commitments_aws_elasticache_ri_commitment.py new file mode 100644 index 0000000000..c16703b498 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_aws_elasticache_ri_commitment.py @@ -0,0 +1,116 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class CommitmentsAwsElasticacheRICommitment(ModelNormal): + @cached_property + def openapi_types(_): + return { + "cache_engine": (str,), + "commitment_id": (str,), + "expiration_date": (str,), + "instance_type": (str,), + "number_of_nfus": (float,), + "number_of_reservations": (float,), + "purchase_option": (str,), + "region": (str,), + "start_date": (str,), + "term_length": (float,), + "utilization": (float,), + } + + attribute_map = { + "cache_engine": "cache_engine", + "commitment_id": "commitment_id", + "expiration_date": "expiration_date", + "instance_type": "instance_type", + "number_of_nfus": "number_of_nfus", + "number_of_reservations": "number_of_reservations", + "purchase_option": "purchase_option", + "region": "region", + "start_date": "start_date", + "term_length": "term_length", + "utilization": "utilization", + } + + def __init__( + self_, + cache_engine: str, + commitment_id: str, + instance_type: str, + purchase_option: str, + region: str, + expiration_date: Union[str, UnsetType] = unset, + number_of_nfus: Union[float, UnsetType] = unset, + number_of_reservations: Union[float, UnsetType] = unset, + start_date: Union[str, UnsetType] = unset, + term_length: Union[float, UnsetType] = unset, + utilization: Union[float, UnsetType] = unset, + **kwargs, + ): + """ + AWS ElastiCache Reserved Instance commitment details. + + :param cache_engine: The cache engine type of the Reserved Instance. + :type cache_engine: str + + :param commitment_id: The unique identifier of the Reserved Instance. + :type commitment_id: str + + :param expiration_date: The expiration date of the commitment. + :type expiration_date: str, optional + + :param instance_type: The ElastiCache instance type. + :type instance_type: str + + :param number_of_nfus: The number of Normalized Capacity Units. + :type number_of_nfus: float, optional + + :param number_of_reservations: The number of reserved instances. + :type number_of_reservations: float, optional + + :param purchase_option: The payment option for the Reserved Instance. + :type purchase_option: str + + :param region: The AWS region of the Reserved Instance. + :type region: str + + :param start_date: The start date of the commitment. + :type start_date: str, optional + + :param term_length: The term length in years. + :type term_length: float, optional + + :param utilization: The utilization percentage of the commitment. + :type utilization: float, optional + """ + if expiration_date is not unset: + kwargs["expiration_date"] = expiration_date + if number_of_nfus is not unset: + kwargs["number_of_nfus"] = number_of_nfus + if number_of_reservations is not unset: + kwargs["number_of_reservations"] = number_of_reservations + if start_date is not unset: + kwargs["start_date"] = start_date + if term_length is not unset: + kwargs["term_length"] = term_length + if utilization is not unset: + kwargs["utilization"] = utilization + super().__init__(kwargs) + + self_.cache_engine = cache_engine + self_.commitment_id = commitment_id + self_.instance_type = instance_type + self_.purchase_option = purchase_option + self_.region = region diff --git a/src/datadog_api_client/v2/model/commitments_aws_rdsri_commitment.py b/src/datadog_api_client/v2/model/commitments_aws_rdsri_commitment.py new file mode 100644 index 0000000000..578b4e00d8 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_aws_rdsri_commitment.py @@ -0,0 +1,124 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class CommitmentsAwsRDSRICommitment(ModelNormal): + @cached_property + def openapi_types(_): + return { + "commitment_id": (str,), + "database_engine": (str,), + "expiration_date": (str,), + "instance_type": (str,), + "is_multi_az": (bool,), + "number_of_nfus": (float,), + "number_of_reservations": (float,), + "purchase_option": (str,), + "region": (str,), + "start_date": (str,), + "term_length": (float,), + "utilization": (float,), + } + + attribute_map = { + "commitment_id": "commitment_id", + "database_engine": "database_engine", + "expiration_date": "expiration_date", + "instance_type": "instance_type", + "is_multi_az": "is_multi_az", + "number_of_nfus": "number_of_nfus", + "number_of_reservations": "number_of_reservations", + "purchase_option": "purchase_option", + "region": "region", + "start_date": "start_date", + "term_length": "term_length", + "utilization": "utilization", + } + + def __init__( + self_, + commitment_id: str, + database_engine: str, + instance_type: str, + purchase_option: str, + region: str, + expiration_date: Union[str, UnsetType] = unset, + is_multi_az: Union[bool, UnsetType] = unset, + number_of_nfus: Union[float, UnsetType] = unset, + number_of_reservations: Union[float, UnsetType] = unset, + start_date: Union[str, UnsetType] = unset, + term_length: Union[float, UnsetType] = unset, + utilization: Union[float, UnsetType] = unset, + **kwargs, + ): + """ + AWS RDS Reserved Instance commitment details. + + :param commitment_id: The unique identifier of the Reserved Instance. + :type commitment_id: str + + :param database_engine: The database engine of the Reserved Instance. + :type database_engine: str + + :param expiration_date: The expiration date of the commitment. + :type expiration_date: str, optional + + :param instance_type: The RDS instance type. + :type instance_type: str + + :param is_multi_az: Whether the Reserved Instance is Multi-AZ. + :type is_multi_az: bool, optional + + :param number_of_nfus: The number of Normalized Capacity Units. + :type number_of_nfus: float, optional + + :param number_of_reservations: The number of reserved instances. + :type number_of_reservations: float, optional + + :param purchase_option: The payment option for the Reserved Instance. + :type purchase_option: str + + :param region: The AWS region of the Reserved Instance. + :type region: str + + :param start_date: The start date of the commitment. + :type start_date: str, optional + + :param term_length: The term length in years. + :type term_length: float, optional + + :param utilization: The utilization percentage of the commitment. + :type utilization: float, optional + """ + if expiration_date is not unset: + kwargs["expiration_date"] = expiration_date + if is_multi_az is not unset: + kwargs["is_multi_az"] = is_multi_az + if number_of_nfus is not unset: + kwargs["number_of_nfus"] = number_of_nfus + if number_of_reservations is not unset: + kwargs["number_of_reservations"] = number_of_reservations + if start_date is not unset: + kwargs["start_date"] = start_date + if term_length is not unset: + kwargs["term_length"] = term_length + if utilization is not unset: + kwargs["utilization"] = utilization + super().__init__(kwargs) + + self_.commitment_id = commitment_id + self_.database_engine = database_engine + self_.instance_type = instance_type + self_.purchase_option = purchase_option + self_.region = region diff --git a/src/datadog_api_client/v2/model/commitments_aws_sp_commitment.py b/src/datadog_api_client/v2/model/commitments_aws_sp_commitment.py new file mode 100644 index 0000000000..83ebdd3e27 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_aws_sp_commitment.py @@ -0,0 +1,94 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class CommitmentsAwsSPCommitment(ModelNormal): + @cached_property + def openapi_types(_): + return { + "commitment_id": (str,), + "committed_spend_per_hour": (float,), + "expiration_date": (str,), + "purchase_option": (str,), + "savings_plan_type": (str,), + "start_date": (str,), + "term_length": (float,), + "utilization": (float,), + } + + attribute_map = { + "commitment_id": "commitment_id", + "committed_spend_per_hour": "committed_spend_per_hour", + "expiration_date": "expiration_date", + "purchase_option": "purchase_option", + "savings_plan_type": "savings_plan_type", + "start_date": "start_date", + "term_length": "term_length", + "utilization": "utilization", + } + + def __init__( + self_, + commitment_id: str, + purchase_option: str, + savings_plan_type: str, + committed_spend_per_hour: Union[float, UnsetType] = unset, + expiration_date: Union[str, UnsetType] = unset, + start_date: Union[str, UnsetType] = unset, + term_length: Union[float, UnsetType] = unset, + utilization: Union[float, UnsetType] = unset, + **kwargs, + ): + """ + AWS Savings Plan commitment details. + + :param commitment_id: The unique identifier of the Savings Plan. + :type commitment_id: str + + :param committed_spend_per_hour: The hourly committed spend for the Savings Plan. + :type committed_spend_per_hour: float, optional + + :param expiration_date: The expiration date of the commitment. + :type expiration_date: str, optional + + :param purchase_option: The payment option for the Savings Plan. + :type purchase_option: str + + :param savings_plan_type: The Savings Plan type. + :type savings_plan_type: str + + :param start_date: The start date of the commitment. + :type start_date: str, optional + + :param term_length: The term length in years. + :type term_length: float, optional + + :param utilization: The utilization percentage of the commitment. + :type utilization: float, optional + """ + if committed_spend_per_hour is not unset: + kwargs["committed_spend_per_hour"] = committed_spend_per_hour + if expiration_date is not unset: + kwargs["expiration_date"] = expiration_date + if start_date is not unset: + kwargs["start_date"] = start_date + if term_length is not unset: + kwargs["term_length"] = term_length + if utilization is not unset: + kwargs["utilization"] = utilization + super().__init__(kwargs) + + self_.commitment_id = commitment_id + self_.purchase_option = purchase_option + self_.savings_plan_type = savings_plan_type diff --git a/src/datadog_api_client/v2/model/commitments_azure_compute_sp_commitment.py b/src/datadog_api_client/v2/model/commitments_azure_compute_sp_commitment.py new file mode 100644 index 0000000000..e1eea28bb8 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_azure_compute_sp_commitment.py @@ -0,0 +1,87 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class CommitmentsAzureComputeSPCommitment(ModelNormal): + @cached_property + def openapi_types(_): + return { + "benefit_name": (str,), + "commitment_id": (str,), + "committed_spend_per_hour": (float,), + "expiration_date": (str,), + "start_date": (str,), + "term_length": (float,), + "utilization": (float,), + } + + attribute_map = { + "benefit_name": "benefit_name", + "commitment_id": "commitment_id", + "committed_spend_per_hour": "committed_spend_per_hour", + "expiration_date": "expiration_date", + "start_date": "start_date", + "term_length": "term_length", + "utilization": "utilization", + } + + def __init__( + self_, + benefit_name: str, + commitment_id: str, + committed_spend_per_hour: Union[float, UnsetType] = unset, + expiration_date: Union[str, UnsetType] = unset, + start_date: Union[str, UnsetType] = unset, + term_length: Union[float, UnsetType] = unset, + utilization: Union[float, UnsetType] = unset, + **kwargs, + ): + """ + Azure Compute Savings Plan commitment details. + + :param benefit_name: The display name of the Azure Savings Plan. + :type benefit_name: str + + :param commitment_id: The unique identifier of the Savings Plan. + :type commitment_id: str + + :param committed_spend_per_hour: The hourly committed spend for the Savings Plan. + :type committed_spend_per_hour: float, optional + + :param expiration_date: The expiration date of the commitment. + :type expiration_date: str, optional + + :param start_date: The start date of the commitment. + :type start_date: str, optional + + :param term_length: The term length in years. + :type term_length: float, optional + + :param utilization: The utilization percentage of the commitment. + :type utilization: float, optional + """ + if committed_spend_per_hour is not unset: + kwargs["committed_spend_per_hour"] = committed_spend_per_hour + if expiration_date is not unset: + kwargs["expiration_date"] = expiration_date + if start_date is not unset: + kwargs["start_date"] = start_date + if term_length is not unset: + kwargs["term_length"] = term_length + if utilization is not unset: + kwargs["utilization"] = utilization + super().__init__(kwargs) + + self_.benefit_name = benefit_name + self_.commitment_id = commitment_id diff --git a/src/datadog_api_client/v2/model/commitments_azure_vmri_commitment.py b/src/datadog_api_client/v2/model/commitments_azure_vmri_commitment.py new file mode 100644 index 0000000000..1f5ea738f9 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_azure_vmri_commitment.py @@ -0,0 +1,113 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.commitments_azure_vmri_status import CommitmentsAzureVMRIStatus + + +class CommitmentsAzureVMRICommitment(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.commitments_azure_vmri_status import CommitmentsAzureVMRIStatus + + return { + "benefit_name": (str,), + "commitment_id": (str,), + "expiration_date": (str,), + "instance_type": (str,), + "meter_sub_category": (str,), + "region": (str,), + "start_date": (str,), + "status": (CommitmentsAzureVMRIStatus,), + "term_length": (float,), + "utilization": (float,), + } + + attribute_map = { + "benefit_name": "benefit_name", + "commitment_id": "commitment_id", + "expiration_date": "expiration_date", + "instance_type": "instance_type", + "meter_sub_category": "meter_sub_category", + "region": "region", + "start_date": "start_date", + "status": "status", + "term_length": "term_length", + "utilization": "utilization", + } + + def __init__( + self_, + benefit_name: str, + commitment_id: str, + instance_type: str, + meter_sub_category: str, + region: str, + status: CommitmentsAzureVMRIStatus, + expiration_date: Union[str, UnsetType] = unset, + start_date: Union[str, UnsetType] = unset, + term_length: Union[float, UnsetType] = unset, + utilization: Union[float, UnsetType] = unset, + **kwargs, + ): + """ + Azure Virtual Machine Reserved Instance commitment details. + + :param benefit_name: The display name of the Azure reservation. + :type benefit_name: str + + :param commitment_id: The unique identifier of the Reserved Instance. + :type commitment_id: str + + :param expiration_date: The expiration date of the commitment. + :type expiration_date: str, optional + + :param instance_type: The Azure VM instance type. + :type instance_type: str + + :param meter_sub_category: The Azure meter sub-category for the reservation. + :type meter_sub_category: str + + :param region: The Azure region of the Reserved Instance. + :type region: str + + :param start_date: The start date of the commitment. + :type start_date: str, optional + + :param status: Status of an Azure VM Reserved Instance. + :type status: CommitmentsAzureVMRIStatus + + :param term_length: The term length in years. + :type term_length: float, optional + + :param utilization: The utilization percentage of the commitment. + :type utilization: float, optional + """ + if expiration_date is not unset: + kwargs["expiration_date"] = expiration_date + if start_date is not unset: + kwargs["start_date"] = start_date + if term_length is not unset: + kwargs["term_length"] = term_length + if utilization is not unset: + kwargs["utilization"] = utilization + super().__init__(kwargs) + + self_.benefit_name = benefit_name + self_.commitment_id = commitment_id + self_.instance_type = instance_type + self_.meter_sub_category = meter_sub_category + self_.region = region + self_.status = status diff --git a/src/datadog_api_client/v2/model/commitments_azure_vmri_status.py b/src/datadog_api_client/v2/model/commitments_azure_vmri_status.py new file mode 100644 index 0000000000..c9cdf7ba0b --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_azure_vmri_status.py @@ -0,0 +1,41 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CommitmentsAzureVMRIStatus(ModelSimple): + """ + Status of an Azure VM Reserved Instance. + + :param value: Must be one of ["running", "expired", "cancelled"]. + :type value: str + """ + + allowed_values = { + "running", + "expired", + "cancelled", + } + RUNNING: ClassVar["CommitmentsAzureVMRIStatus"] + EXPIRED: ClassVar["CommitmentsAzureVMRIStatus"] + CANCELLED: ClassVar["CommitmentsAzureVMRIStatus"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CommitmentsAzureVMRIStatus.RUNNING = CommitmentsAzureVMRIStatus("running") +CommitmentsAzureVMRIStatus.EXPIRED = CommitmentsAzureVMRIStatus("expired") +CommitmentsAzureVMRIStatus.CANCELLED = CommitmentsAzureVMRIStatus("cancelled") diff --git a/src/datadog_api_client/v2/model/commitments_commitment_type.py b/src/datadog_api_client/v2/model/commitments_commitment_type.py new file mode 100644 index 0000000000..7d8f529704 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_commitment_type.py @@ -0,0 +1,38 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CommitmentsCommitmentType(ModelSimple): + """ + Type of commitment. ri for Reserved Instances, sp for Savings Plans. + + :param value: Must be one of ["ri", "sp"]. + :type value: str + """ + + allowed_values = { + "ri", + "sp", + } + RESERVED_INSTANCES: ClassVar["CommitmentsCommitmentType"] + SAVINGS_PLANS: ClassVar["CommitmentsCommitmentType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CommitmentsCommitmentType.RESERVED_INSTANCES = CommitmentsCommitmentType("ri") +CommitmentsCommitmentType.SAVINGS_PLANS = CommitmentsCommitmentType("sp") diff --git a/src/datadog_api_client/v2/model/commitments_coverage_scalar_response.py b/src/datadog_api_client/v2/model/commitments_coverage_scalar_response.py new file mode 100644 index 0000000000..2d9bbc4b60 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_coverage_scalar_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.commitments_scalar_column import CommitmentsScalarColumn + + +class CommitmentsCoverageScalarResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.commitments_scalar_column import CommitmentsScalarColumn + + return { + "columns": ([CommitmentsScalarColumn],), + } + + attribute_map = { + "columns": "columns", + } + + def __init__(self_, columns: List[CommitmentsScalarColumn], **kwargs): + """ + Response containing scalar coverage metrics for cloud commitment programs. + + :param columns: Array of scalar columns in the response. + :type columns: [CommitmentsScalarColumn] + """ + super().__init__(kwargs) + + self_.columns = columns diff --git a/src/datadog_api_client/v2/model/commitments_coverage_timeseries_response.py b/src/datadog_api_client/v2/model/commitments_coverage_timeseries_response.py new file mode 100644 index 0000000000..1366c4038b --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_coverage_timeseries_response.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.commitments_timeseries_metric import CommitmentsTimeseriesMetric + + +class CommitmentsCoverageTimeseriesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.commitments_timeseries_metric import CommitmentsTimeseriesMetric + + return { + "cost": (CommitmentsTimeseriesMetric,), + "hours": (CommitmentsTimeseriesMetric,), + } + + attribute_map = { + "cost": "cost", + "hours": "hours", + } + + def __init__(self_, cost: CommitmentsTimeseriesMetric, hours: CommitmentsTimeseriesMetric, **kwargs): + """ + Response containing timeseries coverage metrics for cloud commitment programs. + + :param cost: A timeseries metric containing timestamps, series values, and optional unit metadata. + :type cost: CommitmentsTimeseriesMetric + + :param hours: A timeseries metric containing timestamps, series values, and optional unit metadata. + :type hours: CommitmentsTimeseriesMetric + """ + super().__init__(kwargs) + + self_.cost = cost + self_.hours = hours diff --git a/src/datadog_api_client/v2/model/commitments_list_item.py b/src/datadog_api_client/v2/model/commitments_list_item.py new file mode 100644 index 0000000000..28dda328ce --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_list_item.py @@ -0,0 +1,112 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class CommitmentsListItem(ModelComposed): + def __init__(self, **kwargs): + """ + A commitment item, which varies based on the provider, product, and commitment type. + + :param availability_zone: The availability zone of the reservation. + :type availability_zone: str, optional + + :param commitment_id: The unique identifier of the Reserved Instance. + :type commitment_id: str + + :param expiration_date: The expiration date of the commitment. + :type expiration_date: str, optional + + :param instance_type: The EC2 instance type. + :type instance_type: str + + :param number_of_nfus: The number of Normalized Capacity Units. + :type number_of_nfus: float, optional + + :param number_of_reservations: The number of reserved instances. + :type number_of_reservations: float, optional + + :param offering_class: The offering class of the Reserved Instance. + :type offering_class: str + + :param operating_system: The operating system of the Reserved Instance. + :type operating_system: str + + :param purchase_option: The payment option for the Reserved Instance. + :type purchase_option: str + + :param region: The AWS region of the Reserved Instance. + :type region: str + + :param start_date: The start date of the commitment. + :type start_date: str, optional + + :param term_length: The term length in years. + :type term_length: float, optional + + :param utilization: The utilization percentage of the commitment. + :type utilization: float, optional + + :param database_engine: The database engine of the Reserved Instance. + :type database_engine: str + + :param is_multi_az: Whether the Reserved Instance is Multi-AZ. + :type is_multi_az: bool, optional + + :param cache_engine: The cache engine type of the Reserved Instance. + :type cache_engine: str + + :param committed_spend_per_hour: The hourly committed spend for the Savings Plan. + :type committed_spend_per_hour: float, optional + + :param savings_plan_type: The Savings Plan type. + :type savings_plan_type: str + + :param benefit_name: The display name of the Azure reservation. + :type benefit_name: str + + :param meter_sub_category: The Azure meter sub-category for the reservation. + :type meter_sub_category: str + + :param status: Status of an Azure VM Reserved Instance. + :type status: CommitmentsAzureVMRIStatus + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.commitments_aws_ec2_ri_commitment import CommitmentsAwsEC2RICommitment + from datadog_api_client.v2.model.commitments_aws_rdsri_commitment import CommitmentsAwsRDSRICommitment + from datadog_api_client.v2.model.commitments_aws_elasticache_ri_commitment import ( + CommitmentsAwsElasticacheRICommitment, + ) + from datadog_api_client.v2.model.commitments_aws_sp_commitment import CommitmentsAwsSPCommitment + from datadog_api_client.v2.model.commitments_azure_vmri_commitment import CommitmentsAzureVMRICommitment + from datadog_api_client.v2.model.commitments_azure_compute_sp_commitment import ( + CommitmentsAzureComputeSPCommitment, + ) + + return { + "oneOf": [ + CommitmentsAwsEC2RICommitment, + CommitmentsAwsRDSRICommitment, + CommitmentsAwsElasticacheRICommitment, + CommitmentsAwsSPCommitment, + CommitmentsAzureVMRICommitment, + CommitmentsAzureComputeSPCommitment, + ], + } diff --git a/src/datadog_api_client/v2/model/commitments_list_meta.py b/src/datadog_api_client/v2/model/commitments_list_meta.py new file mode 100644 index 0000000000..097b73da57 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_list_meta.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.commitments_unit import CommitmentsUnit + + +class CommitmentsListMeta(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.commitments_unit import CommitmentsUnit + + return { + "committed_spend_unit": (CommitmentsUnit,), + } + + attribute_map = { + "committed_spend_unit": "committed_spend_unit", + } + + def __init__(self_, committed_spend_unit: Union[CommitmentsUnit, UnsetType] = unset, **kwargs): + """ + Metadata for a commitments list response. + + :param committed_spend_unit: Unit metadata for a numeric metric. + :type committed_spend_unit: CommitmentsUnit, optional + """ + if committed_spend_unit is not unset: + kwargs["committed_spend_unit"] = committed_spend_unit + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/commitments_list_response.py b/src/datadog_api_client/v2/model/commitments_list_response.py new file mode 100644 index 0000000000..eec42e6d7c --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_list_response.py @@ -0,0 +1,74 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.commitments_list_item import CommitmentsListItem + from datadog_api_client.v2.model.commitments_list_meta import CommitmentsListMeta + from datadog_api_client.v2.model.commitments_aws_ec2_ri_commitment import CommitmentsAwsEC2RICommitment + from datadog_api_client.v2.model.commitments_aws_rdsri_commitment import CommitmentsAwsRDSRICommitment + from datadog_api_client.v2.model.commitments_aws_elasticache_ri_commitment import ( + CommitmentsAwsElasticacheRICommitment, + ) + from datadog_api_client.v2.model.commitments_aws_sp_commitment import CommitmentsAwsSPCommitment + from datadog_api_client.v2.model.commitments_azure_vmri_commitment import CommitmentsAzureVMRICommitment + from datadog_api_client.v2.model.commitments_azure_compute_sp_commitment import CommitmentsAzureComputeSPCommitment + + +class CommitmentsListResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.commitments_list_item import CommitmentsListItem + from datadog_api_client.v2.model.commitments_list_meta import CommitmentsListMeta + + return { + "commitments": ([CommitmentsListItem],), + "meta": (CommitmentsListMeta,), + } + + attribute_map = { + "commitments": "commitments", + "meta": "meta", + } + + def __init__( + self_, + commitments: List[ + Union[ + CommitmentsListItem, + CommitmentsAwsEC2RICommitment, + CommitmentsAwsRDSRICommitment, + CommitmentsAwsElasticacheRICommitment, + CommitmentsAwsSPCommitment, + CommitmentsAzureVMRICommitment, + CommitmentsAzureComputeSPCommitment, + ] + ], + meta: Union[CommitmentsListMeta, UnsetType] = unset, + **kwargs, + ): + """ + Response containing a list of cloud commitment details. + + :param commitments: Array of commitment items. + :type commitments: [CommitmentsListItem] + + :param meta: Metadata for a commitments list response. + :type meta: CommitmentsListMeta, optional + """ + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) + + self_.commitments = commitments diff --git a/src/datadog_api_client/v2/model/commitments_on_demand_hotspots_scalar_meta.py b/src/datadog_api_client/v2/model/commitments_on_demand_hotspots_scalar_meta.py new file mode 100644 index 0000000000..62ae448516 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_on_demand_hotspots_scalar_meta.py @@ -0,0 +1,33 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class CommitmentsOnDemandHotspotsScalarMeta(ModelNormal): + @cached_property + def openapi_types(_): + return { + "on_demand_filters": (str,), + } + + attribute_map = { + "on_demand_filters": "on_demand_filters", + } + + def __init__(self_, on_demand_filters: str, **kwargs): + """ + Metadata for the on-demand hot-spots scalar response. + + :param on_demand_filters: Active on-demand filters applied to the response. + :type on_demand_filters: str + """ + super().__init__(kwargs) + + self_.on_demand_filters = on_demand_filters diff --git a/src/datadog_api_client/v2/model/commitments_on_demand_hotspots_scalar_response.py b/src/datadog_api_client/v2/model/commitments_on_demand_hotspots_scalar_response.py new file mode 100644 index 0000000000..2224ab00ca --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_on_demand_hotspots_scalar_response.py @@ -0,0 +1,67 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.commitments_scalar_column import CommitmentsScalarColumn + from datadog_api_client.v2.model.commitments_on_demand_hotspots_scalar_meta import ( + CommitmentsOnDemandHotspotsScalarMeta, + ) + + +class CommitmentsOnDemandHotspotsScalarResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.commitments_scalar_column import CommitmentsScalarColumn + from datadog_api_client.v2.model.commitments_on_demand_hotspots_scalar_meta import ( + CommitmentsOnDemandHotspotsScalarMeta, + ) + + return { + "columns": ([CommitmentsScalarColumn],), + "meta": (CommitmentsOnDemandHotspotsScalarMeta,), + "total": ([CommitmentsScalarColumn],), + } + + attribute_map = { + "columns": "columns", + "meta": "meta", + "total": "total", + } + + def __init__( + self_, + columns: List[CommitmentsScalarColumn], + total: List[CommitmentsScalarColumn], + meta: Union[CommitmentsOnDemandHotspotsScalarMeta, UnsetType] = unset, + **kwargs, + ): + """ + Response containing scalar on-demand hot-spots data for cloud commitment programs. + + :param columns: Array of scalar columns in the response. + :type columns: [CommitmentsScalarColumn] + + :param meta: Metadata for the on-demand hot-spots scalar response. + :type meta: CommitmentsOnDemandHotspotsScalarMeta, optional + + :param total: Array of scalar columns in the response. + :type total: [CommitmentsScalarColumn] + """ + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) + + self_.columns = columns + self_.total = total diff --git a/src/datadog_api_client/v2/model/commitments_provider.py b/src/datadog_api_client/v2/model/commitments_provider.py new file mode 100644 index 0000000000..910c09edce --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_provider.py @@ -0,0 +1,38 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CommitmentsProvider(ModelSimple): + """ + Cloud provider for commitment programs. + + :param value: Must be one of ["aws", "azure"]. + :type value: str + """ + + allowed_values = { + "aws", + "azure", + } + AWS: ClassVar["CommitmentsProvider"] + AZURE: ClassVar["CommitmentsProvider"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CommitmentsProvider.AWS = CommitmentsProvider("aws") +CommitmentsProvider.AZURE = CommitmentsProvider("azure") diff --git a/src/datadog_api_client/v2/model/commitments_savings_scalar_response.py b/src/datadog_api_client/v2/model/commitments_savings_scalar_response.py new file mode 100644 index 0000000000..bba207b9ac --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_savings_scalar_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.commitments_scalar_column import CommitmentsScalarColumn + + +class CommitmentsSavingsScalarResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.commitments_scalar_column import CommitmentsScalarColumn + + return { + "columns": ([CommitmentsScalarColumn],), + } + + attribute_map = { + "columns": "columns", + } + + def __init__(self_, columns: List[CommitmentsScalarColumn], **kwargs): + """ + Response containing scalar savings metrics for cloud commitment programs. + + :param columns: Array of scalar columns in the response. + :type columns: [CommitmentsScalarColumn] + """ + super().__init__(kwargs) + + self_.columns = columns diff --git a/src/datadog_api_client/v2/model/commitments_savings_timeseries_response.py b/src/datadog_api_client/v2/model/commitments_savings_timeseries_response.py new file mode 100644 index 0000000000..7da44c9036 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_savings_timeseries_response.py @@ -0,0 +1,65 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.commitments_timeseries_metric import CommitmentsTimeseriesMetric + + +class CommitmentsSavingsTimeseriesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.commitments_timeseries_metric import CommitmentsTimeseriesMetric + + return { + "actual_cost": (CommitmentsTimeseriesMetric,), + "effective_savings_rate": (CommitmentsTimeseriesMetric,), + "on_demand_equivalent_cost": (CommitmentsTimeseriesMetric,), + "realized_savings": (CommitmentsTimeseriesMetric,), + } + + attribute_map = { + "actual_cost": "actual_cost", + "effective_savings_rate": "effective_savings_rate", + "on_demand_equivalent_cost": "on_demand_equivalent_cost", + "realized_savings": "realized_savings", + } + + def __init__( + self_, + actual_cost: CommitmentsTimeseriesMetric, + effective_savings_rate: CommitmentsTimeseriesMetric, + on_demand_equivalent_cost: CommitmentsTimeseriesMetric, + realized_savings: CommitmentsTimeseriesMetric, + **kwargs, + ): + """ + Response containing timeseries savings metrics for cloud commitment programs. + + :param actual_cost: A timeseries metric containing timestamps, series values, and optional unit metadata. + :type actual_cost: CommitmentsTimeseriesMetric + + :param effective_savings_rate: A timeseries metric containing timestamps, series values, and optional unit metadata. + :type effective_savings_rate: CommitmentsTimeseriesMetric + + :param on_demand_equivalent_cost: A timeseries metric containing timestamps, series values, and optional unit metadata. + :type on_demand_equivalent_cost: CommitmentsTimeseriesMetric + + :param realized_savings: A timeseries metric containing timestamps, series values, and optional unit metadata. + :type realized_savings: CommitmentsTimeseriesMetric + """ + super().__init__(kwargs) + + self_.actual_cost = actual_cost + self_.effective_savings_rate = effective_savings_rate + self_.on_demand_equivalent_cost = on_demand_equivalent_cost + self_.realized_savings = realized_savings diff --git a/src/datadog_api_client/v2/model/commitments_scalar_column.py b/src/datadog_api_client/v2/model/commitments_scalar_column.py new file mode 100644 index 0000000000..8829e841c9 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_scalar_column.py @@ -0,0 +1,74 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.commitments_scalar_column_meta import CommitmentsScalarColumnMeta + from datadog_api_client.v2.model.commitments_scalar_column_type import CommitmentsScalarColumnType + + +class CommitmentsScalarColumn(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.commitments_scalar_column_meta import CommitmentsScalarColumnMeta + from datadog_api_client.v2.model.commitments_scalar_column_type import CommitmentsScalarColumnType + + return { + "meta": (CommitmentsScalarColumnMeta,), + "name": (str,), + "type": (CommitmentsScalarColumnType,), + "values": ([bool, date, datetime, dict, float, int, list, str, UUID, none_type],), + } + + attribute_map = { + "meta": "meta", + "name": "name", + "type": "type", + "values": "values", + } + + def __init__( + self_, + name: str, + type: CommitmentsScalarColumnType, + values: List[Any], + meta: Union[CommitmentsScalarColumnMeta, UnsetType] = unset, + **kwargs, + ): + """ + A column in a scalar response. When type is "group", values contains arrays of strings. When type is "number", values contains numeric values. + + :param meta: Metadata for a scalar column, including unit information. + :type meta: CommitmentsScalarColumnMeta, optional + + :param name: The column name. + :type name: str + + :param type: The column type. "group" for dimension columns, "number" for metric columns. + :type type: CommitmentsScalarColumnType + + :param values: Values for a scalar column. Arrays of strings for group columns, numbers for value columns. + :type values: [bool, date, datetime, dict, float, int, list, str, UUID, none_type] + """ + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) + + self_.name = name + self_.type = type + self_.values = values diff --git a/src/datadog_api_client/v2/model/commitments_scalar_column_meta.py b/src/datadog_api_client/v2/model/commitments_scalar_column_meta.py new file mode 100644 index 0000000000..736a2edc1b --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_scalar_column_meta.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.commitments_unit import CommitmentsUnit + + +class CommitmentsScalarColumnMeta(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.commitments_unit import CommitmentsUnit + + return { + "unit": (CommitmentsUnit,), + } + + attribute_map = { + "unit": "unit", + } + + def __init__(self_, unit: CommitmentsUnit, **kwargs): + """ + Metadata for a scalar column, including unit information. + + :param unit: Unit metadata for a numeric metric. + :type unit: CommitmentsUnit + """ + super().__init__(kwargs) + + self_.unit = unit diff --git a/src/datadog_api_client/v2/model/commitments_scalar_column_type.py b/src/datadog_api_client/v2/model/commitments_scalar_column_type.py new file mode 100644 index 0000000000..8a8b247175 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_scalar_column_type.py @@ -0,0 +1,38 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CommitmentsScalarColumnType(ModelSimple): + """ + The column type. "group" for dimension columns, "number" for metric columns. + + :param value: Must be one of ["group", "number"]. + :type value: str + """ + + allowed_values = { + "group", + "number", + } + GROUP: ClassVar["CommitmentsScalarColumnType"] + NUMBER: ClassVar["CommitmentsScalarColumnType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CommitmentsScalarColumnType.GROUP = CommitmentsScalarColumnType("group") +CommitmentsScalarColumnType.NUMBER = CommitmentsScalarColumnType("number") diff --git a/src/datadog_api_client/v2/model/commitments_timeseries_metric.py b/src/datadog_api_client/v2/model/commitments_timeseries_metric.py new file mode 100644 index 0000000000..d881e94eb1 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_timeseries_metric.py @@ -0,0 +1,63 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.commitments_timeseries_series import CommitmentsTimeseriesSeries + from datadog_api_client.v2.model.commitments_unit import CommitmentsUnit + + +class CommitmentsTimeseriesMetric(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.commitments_timeseries_series import CommitmentsTimeseriesSeries + from datadog_api_client.v2.model.commitments_unit import CommitmentsUnit + + return { + "series": (CommitmentsTimeseriesSeries,), + "times": ([int],), + "unit": (CommitmentsUnit,), + } + + attribute_map = { + "series": "series", + "times": "times", + "unit": "unit", + } + + def __init__( + self_, + series: CommitmentsTimeseriesSeries, + times: List[int], + unit: Union[CommitmentsUnit, UnsetType] = unset, + **kwargs, + ): + """ + A timeseries metric containing timestamps, series values, and optional unit metadata. + + :param series: Timeseries data as a map of series names to their corresponding value arrays. + :type series: CommitmentsTimeseriesSeries + + :param times: Unix timestamps in seconds for the timeseries data points. + :type times: [int] + + :param unit: Unit metadata for a numeric metric. + :type unit: CommitmentsUnit, optional + """ + if unit is not unset: + kwargs["unit"] = unit + super().__init__(kwargs) + + self_.series = series + self_.times = times diff --git a/src/datadog_api_client/v2/model/commitments_timeseries_series.py b/src/datadog_api_client/v2/model/commitments_timeseries_series.py new file mode 100644 index 0000000000..a7975f6c67 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_timeseries_series.py @@ -0,0 +1,27 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + pass + + +class CommitmentsTimeseriesSeries(ModelNormal): + @cached_property + def additional_properties_type(_): + return ([float],) + + def __init__(self_, **kwargs): + """ + Timeseries data as a map of series names to their corresponding value arrays. + """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/commitments_unit.py b/src/datadog_api_client/v2/model/commitments_unit.py new file mode 100644 index 0000000000..759a18dcdf --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_unit.py @@ -0,0 +1,63 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class CommitmentsUnit(ModelNormal): + @cached_property + def openapi_types(_): + return { + "family": (str,), + "id": (int,), + "name": (str,), + "plural": (str,), + "scale_factor": (float,), + "short_name": (str,), + } + + attribute_map = { + "family": "family", + "id": "id", + "name": "name", + "plural": "plural", + "scale_factor": "scale_factor", + "short_name": "short_name", + } + + def __init__(self_, family: str, id: int, name: str, plural: str, scale_factor: float, short_name: str, **kwargs): + """ + Unit metadata for a numeric metric. + + :param family: The unit family (for example, percentage or money). + :type family: str + + :param id: The unit identifier. + :type id: int + + :param name: The unit name (for example, percent or dollar). + :type name: str + + :param plural: The plural form of the unit name. + :type plural: str + + :param scale_factor: The scale factor for the unit. + :type scale_factor: float + + :param short_name: The abbreviated unit name (for example, % or $). + :type short_name: str + """ + super().__init__(kwargs) + + self_.family = family + self_.id = id + self_.name = name + self_.plural = plural + self_.scale_factor = scale_factor + self_.short_name = short_name diff --git a/src/datadog_api_client/v2/model/commitments_utilization_scalar_product_breakdown_entry.py b/src/datadog_api_client/v2/model/commitments_utilization_scalar_product_breakdown_entry.py new file mode 100644 index 0000000000..0cd3ee1a8e --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_utilization_scalar_product_breakdown_entry.py @@ -0,0 +1,39 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class CommitmentsUtilizationScalarProductBreakdownEntry(ModelNormal): + @cached_property + def openapi_types(_): + return { + "product": (str,), + "utilization": (float,), + } + + attribute_map = { + "product": "product", + "utilization": "utilization", + } + + def __init__(self_, product: str, utilization: float, **kwargs): + """ + Per-product utilization data in a scalar utilization response. + + :param product: The cloud product name. + :type product: str + + :param utilization: The utilization percentage for the product. + :type utilization: float + """ + super().__init__(kwargs) + + self_.product = product + self_.utilization = utilization diff --git a/src/datadog_api_client/v2/model/commitments_utilization_scalar_response.py b/src/datadog_api_client/v2/model/commitments_utilization_scalar_response.py new file mode 100644 index 0000000000..dc8ef24fa9 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_utilization_scalar_response.py @@ -0,0 +1,60 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.commitments_scalar_column import CommitmentsScalarColumn + from datadog_api_client.v2.model.commitments_utilization_scalar_product_breakdown_entry import ( + CommitmentsUtilizationScalarProductBreakdownEntry, + ) + + +class CommitmentsUtilizationScalarResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.commitments_scalar_column import CommitmentsScalarColumn + from datadog_api_client.v2.model.commitments_utilization_scalar_product_breakdown_entry import ( + CommitmentsUtilizationScalarProductBreakdownEntry, + ) + + return { + "columns": ([CommitmentsScalarColumn],), + "product_breakdown": ([CommitmentsUtilizationScalarProductBreakdownEntry],), + } + + attribute_map = { + "columns": "columns", + "product_breakdown": "product_breakdown", + } + + def __init__( + self_, + columns: List[CommitmentsScalarColumn], + product_breakdown: Union[List[CommitmentsUtilizationScalarProductBreakdownEntry], UnsetType] = unset, + **kwargs, + ): + """ + Response containing scalar utilization metrics for cloud commitment programs. + + :param columns: Array of scalar columns in the response. + :type columns: [CommitmentsScalarColumn] + + :param product_breakdown: Array of per-product utilization breakdown entries. + :type product_breakdown: [CommitmentsUtilizationScalarProductBreakdownEntry], optional + """ + if product_breakdown is not unset: + kwargs["product_breakdown"] = product_breakdown + super().__init__(kwargs) + + self_.columns = columns diff --git a/src/datadog_api_client/v2/model/commitments_utilization_timeseries_response.py b/src/datadog_api_client/v2/model/commitments_utilization_timeseries_response.py new file mode 100644 index 0000000000..ed1234a991 --- /dev/null +++ b/src/datadog_api_client/v2/model/commitments_utilization_timeseries_response.py @@ -0,0 +1,63 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.commitments_timeseries_series import CommitmentsTimeseriesSeries + from datadog_api_client.v2.model.commitments_unit import CommitmentsUnit + + +class CommitmentsUtilizationTimeseriesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.commitments_timeseries_series import CommitmentsTimeseriesSeries + from datadog_api_client.v2.model.commitments_unit import CommitmentsUnit + + return { + "series": (CommitmentsTimeseriesSeries,), + "times": ([int],), + "unit": (CommitmentsUnit,), + } + + attribute_map = { + "series": "series", + "times": "times", + "unit": "unit", + } + + def __init__( + self_, + series: CommitmentsTimeseriesSeries, + times: List[int], + unit: Union[CommitmentsUnit, UnsetType] = unset, + **kwargs, + ): + """ + Response containing timeseries utilization metrics for cloud commitment programs. + + :param series: Timeseries data as a map of series names to their corresponding value arrays. + :type series: CommitmentsTimeseriesSeries + + :param times: Unix timestamps in seconds for the timeseries data points. + :type times: [int] + + :param unit: Unit metadata for a numeric metric. + :type unit: CommitmentsUnit, optional + """ + if unit is not unset: + kwargs["unit"] = unit + super().__init__(kwargs) + + self_.series = series + self_.times = times diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 3bb64eb0bb..ed2eba1aa3 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1057,6 +1057,39 @@ ) from datadog_api_client.v2.model.commit_coverage_summary_request_data import CommitCoverageSummaryRequestData from datadog_api_client.v2.model.commit_coverage_summary_request_type import CommitCoverageSummaryRequestType +from datadog_api_client.v2.model.commitments_aws_ec2_ri_commitment import CommitmentsAwsEC2RICommitment +from datadog_api_client.v2.model.commitments_aws_elasticache_ri_commitment import CommitmentsAwsElasticacheRICommitment +from datadog_api_client.v2.model.commitments_aws_rdsri_commitment import CommitmentsAwsRDSRICommitment +from datadog_api_client.v2.model.commitments_aws_sp_commitment import CommitmentsAwsSPCommitment +from datadog_api_client.v2.model.commitments_azure_compute_sp_commitment import CommitmentsAzureComputeSPCommitment +from datadog_api_client.v2.model.commitments_azure_vmri_commitment import CommitmentsAzureVMRICommitment +from datadog_api_client.v2.model.commitments_azure_vmri_status import CommitmentsAzureVMRIStatus +from datadog_api_client.v2.model.commitments_commitment_type import CommitmentsCommitmentType +from datadog_api_client.v2.model.commitments_coverage_scalar_response import CommitmentsCoverageScalarResponse +from datadog_api_client.v2.model.commitments_coverage_timeseries_response import CommitmentsCoverageTimeseriesResponse +from datadog_api_client.v2.model.commitments_list_item import CommitmentsListItem +from datadog_api_client.v2.model.commitments_list_meta import CommitmentsListMeta +from datadog_api_client.v2.model.commitments_list_response import CommitmentsListResponse +from datadog_api_client.v2.model.commitments_on_demand_hotspots_scalar_meta import CommitmentsOnDemandHotspotsScalarMeta +from datadog_api_client.v2.model.commitments_on_demand_hotspots_scalar_response import ( + CommitmentsOnDemandHotspotsScalarResponse, +) +from datadog_api_client.v2.model.commitments_provider import CommitmentsProvider +from datadog_api_client.v2.model.commitments_savings_scalar_response import CommitmentsSavingsScalarResponse +from datadog_api_client.v2.model.commitments_savings_timeseries_response import CommitmentsSavingsTimeseriesResponse +from datadog_api_client.v2.model.commitments_scalar_column import CommitmentsScalarColumn +from datadog_api_client.v2.model.commitments_scalar_column_meta import CommitmentsScalarColumnMeta +from datadog_api_client.v2.model.commitments_scalar_column_type import CommitmentsScalarColumnType +from datadog_api_client.v2.model.commitments_timeseries_metric import CommitmentsTimeseriesMetric +from datadog_api_client.v2.model.commitments_timeseries_series import CommitmentsTimeseriesSeries +from datadog_api_client.v2.model.commitments_unit import CommitmentsUnit +from datadog_api_client.v2.model.commitments_utilization_scalar_product_breakdown_entry import ( + CommitmentsUtilizationScalarProductBreakdownEntry, +) +from datadog_api_client.v2.model.commitments_utilization_scalar_response import CommitmentsUtilizationScalarResponse +from datadog_api_client.v2.model.commitments_utilization_timeseries_response import ( + CommitmentsUtilizationTimeseriesResponse, +) from datadog_api_client.v2.model.completion_condition import CompletionCondition from datadog_api_client.v2.model.completion_condition_operator import CompletionConditionOperator from datadog_api_client.v2.model.completion_gate import CompletionGate @@ -8362,6 +8395,33 @@ "CommitCoverageSummaryRequestAttributes", "CommitCoverageSummaryRequestData", "CommitCoverageSummaryRequestType", + "CommitmentsAwsEC2RICommitment", + "CommitmentsAwsElasticacheRICommitment", + "CommitmentsAwsRDSRICommitment", + "CommitmentsAwsSPCommitment", + "CommitmentsAzureComputeSPCommitment", + "CommitmentsAzureVMRICommitment", + "CommitmentsAzureVMRIStatus", + "CommitmentsCommitmentType", + "CommitmentsCoverageScalarResponse", + "CommitmentsCoverageTimeseriesResponse", + "CommitmentsListItem", + "CommitmentsListMeta", + "CommitmentsListResponse", + "CommitmentsOnDemandHotspotsScalarMeta", + "CommitmentsOnDemandHotspotsScalarResponse", + "CommitmentsProvider", + "CommitmentsSavingsScalarResponse", + "CommitmentsSavingsTimeseriesResponse", + "CommitmentsScalarColumn", + "CommitmentsScalarColumnMeta", + "CommitmentsScalarColumnType", + "CommitmentsTimeseriesMetric", + "CommitmentsTimeseriesSeries", + "CommitmentsUnit", + "CommitmentsUtilizationScalarProductBreakdownEntry", + "CommitmentsUtilizationScalarResponse", + "CommitmentsUtilizationTimeseriesResponse", "CompletionCondition", "CompletionConditionOperator", "CompletionGate", diff --git a/tests/v2/features/cloud_cost_management.feature b/tests/v2/features/cloud_cost_management.feature index bf9f695d40..33d3cfa5ff 100644 --- a/tests/v2/features/cloud_cost_management.feature +++ b/tests/v2/features/cloud_cost_management.feature @@ -273,6 +273,182 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments coverage (scalar) returns "Bad Request" response + Given operation "GetCommitmentsCoverageScalar" enabled + And new "GetCommitmentsCoverageScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments coverage (scalar) returns "OK" response + Given operation "GetCommitmentsCoverageScalar" enabled + And new "GetCommitmentsCoverageScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments coverage (timeseries) returns "Bad Request" response + Given operation "GetCommitmentsCoverageTimeseries" enabled + And new "GetCommitmentsCoverageTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments coverage (timeseries) returns "OK" response + Given operation "GetCommitmentsCoverageTimeseries" enabled + And new "GetCommitmentsCoverageTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments list returns "Bad Request" response + Given operation "GetCommitmentsCommitmentList" enabled + And new "GetCommitmentsCommitmentList" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments list returns "OK" response + Given operation "GetCommitmentsCommitmentList" enabled + And new "GetCommitmentsCommitmentList" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments on-demand hot spots (scalar) returns "Bad Request" response + Given operation "GetCommitmentsOnDemandHotspotsScalar" enabled + And new "GetCommitmentsOnDemandHotspotsScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments on-demand hot spots (scalar) returns "OK" response + Given operation "GetCommitmentsOnDemandHotspotsScalar" enabled + And new "GetCommitmentsOnDemandHotspotsScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments savings (scalar) returns "Bad Request" response + Given operation "GetCommitmentsSavingsScalar" enabled + And new "GetCommitmentsSavingsScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments savings (scalar) returns "OK" response + Given operation "GetCommitmentsSavingsScalar" enabled + And new "GetCommitmentsSavingsScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments savings (timeseries) returns "Bad Request" response + Given operation "GetCommitmentsSavingsTimeseries" enabled + And new "GetCommitmentsSavingsTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments savings (timeseries) returns "OK" response + Given operation "GetCommitmentsSavingsTimeseries" enabled + And new "GetCommitmentsSavingsTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments utilization (scalar) returns "Bad Request" response + Given operation "GetCommitmentsUtilizationScalar" enabled + And new "GetCommitmentsUtilizationScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments utilization (scalar) returns "OK" response + Given operation "GetCommitmentsUtilizationScalar" enabled + And new "GetCommitmentsUtilizationScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments utilization (timeseries) returns "Bad Request" response + Given operation "GetCommitmentsUtilizationTimeseries" enabled + And new "GetCommitmentsUtilizationTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments utilization (timeseries) returns "OK" response + Given operation "GetCommitmentsUtilizationTimeseries" enabled + And new "GetCommitmentsUtilizationTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: Get cost AWS CUR config returns "OK" response Given new "GetCostAWSCURConfig" request diff --git a/tests/v2/features/incidents.feature b/tests/v2/features/incidents.feature index df4c5fe28d..119fa0a284 100644 --- a/tests/v2/features/incidents.feature +++ b/tests/v2/features/incidents.feature @@ -170,7 +170,7 @@ Feature: Incidents When the request is sent Then the response status is 400 Bad Request - @skip-terraform-config @skip-validation @team:Datadog/incident-app + @skip-validation @team:Datadog/incident-app Scenario: Create an incident type returns "CREATED" response Given operation "CreateIncidentType" enabled And new "CreateIncidentType" request @@ -255,7 +255,7 @@ Feature: Incidents When the request is sent Then the response status is 400 Bad Request - @skip-terraform-config @team:Datadog/incident-app + @team:Datadog/incident-app Scenario: Create incident notification rule returns "Created" response Given there is a valid "incident_type" in the system And operation "CreateIncidentNotificationRule" enabled @@ -573,7 +573,7 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found - @skip-terraform-config @team:Datadog/incident-app + @team:Datadog/incident-app Scenario: Delete incident notification rule returns "No Content" response Given there is a valid "incident_type" in the system And there is a valid "notification_rule" in the system @@ -591,7 +591,7 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found - @skip-terraform-config @team:Datadog/incident-app + @team:Datadog/incident-app Scenario: Delete incident notification template returns "No Content" response Given there is a valid "incident_type" in the system And there is a valid "notification_template" in the system @@ -832,7 +832,7 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found - @skip-terraform-config @team:Datadog/incident-app + @team:Datadog/incident-app Scenario: Get incident notification rule returns "OK" response Given there is a valid "incident_type" in the system And there is a valid "notification_rule" in the system @@ -860,7 +860,7 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found - @skip-terraform-config @team:Datadog/incident-app + @team:Datadog/incident-app Scenario: Get incident notification template returns "OK" response Given there is a valid "incident_type" in the system And there is a valid "notification_template" in the system @@ -1075,7 +1075,7 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found - @skip-terraform-config @team:Datadog/incident-app + @team:Datadog/incident-app Scenario: List incident notification rules returns "OK" response Given there is a valid "incident_type" in the system And there is a valid "notification_rule" in the system @@ -1432,7 +1432,7 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found - @skip-terraform-config @team:Datadog/incident-app + @team:Datadog/incident-app Scenario: Update incident notification rule returns "OK" response Given there is a valid "incident_type" in the system And there is a valid "notification_rule" in the system @@ -1465,7 +1465,7 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found - @skip-terraform-config @team:Datadog/incident-app + @team:Datadog/incident-app Scenario: Update incident notification template returns "OK" response Given there is a valid "incident_type" in the system And there is a valid "notification_template" in the system diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 1ca1c2309a..4d0e2e8f23 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1410,6 +1410,54 @@ "type": "safe" } }, + "GetCommitmentsCommitmentList": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsCoverageScalar": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsCoverageTimeseries": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsOnDemandHotspotsScalar": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsSavingsScalar": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsSavingsTimeseries": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsUtilizationScalar": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsUtilizationTimeseries": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCustomCostsFiles": { "tag": "Cloud Cost Management", "undo": {