diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 8e540e2cff55..4ecfbd0c5048 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -21328,13 +21328,6 @@ components: - description: "If this is a string, it must be a valid JavaScript expression that evaluates to a boolean." example: "${true}" type: string - ComponentRecommendation: - description: Resource recommendation for a single Spark component (driver or executor). Contains estimation data used to patch Spark job specs. - properties: - estimation: - $ref: "#/components/schemas/Estimation" - required: [estimation] - type: object ComponentType: description: The UI component type. enum: @@ -24057,23 +24050,6 @@ components: type: string x-enum-varnames: - CI_APP_COVERAGE_SUMMARY - Cpu: - description: CPU usage statistics derived from historical Spark job metrics. Provides multiple estimates so users can choose between conservative and cost-saving risk profiles. - properties: - max: - description: Maximum CPU usage observed for the job, expressed in millicores. This represents the upper bound of usage. - format: int64 - type: integer - p75: - description: 75th percentile of CPU usage (millicores). Represents a cost-saving configuration while covering most workloads. - format: int64 - type: integer - p95: - description: 95th percentile of CPU usage (millicores). Balances performance and cost, providing a safer margin than p75. - format: int64 - type: integer - type: object - x-model-simple-name: SpaCpu CreateActionConnectionRequest: description: Request used to create an action connection. properties: @@ -40501,28 +40477,6 @@ components: type: string x-enum-varnames: - ESCALATION_POLICY_STEPS - Estimation: - description: Recommended resource values for a Spark driver or executor, derived from recent real usage metrics. Used by SPA to propose more efficient pod sizing. - properties: - cpu: - $ref: "#/components/schemas/Cpu" - ephemeral_storage: - description: Recommended ephemeral storage allocation (in MiB). Derived from job temporary storage patterns. - format: int64 - type: integer - heap: - description: Recommended JVM heap size (in MiB). - format: int64 - type: integer - memory: - description: Recommended total memory allocation (in MiB). Includes both heap and overhead. - format: int64 - type: integer - overhead: - description: Recommended JVM overhead (in MiB). Computed as total memory - heap. - format: int64 - type: integer - type: object Event: additionalProperties: {} description: The metadata associated with a request. @@ -101716,96 +101670,6 @@ components: required: - data type: object - RecommendationAttributes: - description: Attributes of the SPA Recommendation resource. Contains recommendations for both driver and executor components. - properties: - confidence_level: - description: The confidence level of the recommendation, expressed as a value between 0.0 (low confidence) and 1.0 (high confidence). - format: double - type: number - driver: - $ref: "#/components/schemas/ComponentRecommendation" - executor: - $ref: "#/components/schemas/ComponentRecommendation" - matched_params: - description: |- - Only returned by the v2 endpoint. The job parameters whose values the recommendation was matched on, as `parameter=value` pairs joined by `|`. - An empty string means the service-wide (coarse) recommendation was used. - example: "detailed_metrics=false|Region=US1" - type: string - required: [driver, executor] - type: object - RecommendationData: - description: JSON:API resource object for SPA Recommendation. Includes type, optional ID, and resource attributes with structured recommendations. - properties: - attributes: - $ref: "#/components/schemas/RecommendationAttributes" - id: - description: Resource identifier for the recommendation. Optional in responses. - type: string - type: - $ref: "#/components/schemas/RecommendationType" - required: [type, attributes] - type: object - RecommendationDocument: - description: JSON:API document containing a single Recommendation resource. Returned by SPA when the Spark Gateway requests recommendations. - properties: - data: - $ref: "#/components/schemas/RecommendationData" - required: [data] - type: object - RecommendationType: - default: recommendation - description: JSON:API resource type for Spark Pod Autosizing recommendations. Identifies the Recommendation resource returned by SPA. - enum: - - recommendation - example: recommendation - type: string - x-enum-varnames: - - RECOMMENDATION - RecommendationV2RequestAttributes: - description: |- - Attributes for requesting SPA recommendations by forwarding a Spark job's raw arguments - instead of a pre-computed shard. - properties: - arguments: - description: |- - Raw, unfiltered Spark job arguments as submitted (for example, `--org_id=2`). - SPA determines which arguments are relevant for the given service. - example: - - "" - items: - type: string - type: array - required: [arguments] - type: object - RecommendationV2RequestBody: - description: |- - Request body for retrieving SPA recommendations by forwarding a Spark job's raw arguments - instead of a pre-computed shard. - properties: - data: - $ref: "#/components/schemas/RecommendationV2RequestData" - required: [data] - type: object - RecommendationV2RequestData: - description: JSON:API resource object for the SPA v2 recommendation request. - properties: - attributes: - $ref: "#/components/schemas/RecommendationV2RequestAttributes" - type: - $ref: "#/components/schemas/RecommendationV2RequestType" - required: [type, attributes] - type: object - RecommendationV2RequestType: - default: recommendation_v2_request - description: JSON:API resource type for the SPA v2 recommendation request. - enum: - - recommendation_v2_request - example: recommendation_v2_request - type: string - x-enum-varnames: - - RECOMMENDATION_V2_REQUEST RecommendationsFilterRequest: description: JSON:API request body for filtering cost recommendations. example: @@ -234730,185 +234594,6 @@ paths: 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/spa/recommendations-v2/{service}: - post: - description: |- - This endpoint is experimental and restricted to Datadog internal use only. - Retrieve resource recommendations for a Spark job. The caller (Spark Gateway) provides - a service name and the job's raw arguments. SPA determines which arguments are relevant - for the service and returns structured recommendations for driver and executor resources. - operationId: GetSPARecommendationsV2 - parameters: - - description: The service name for a Spark job - in: path - name: service - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/RecommendationV2RequestBody" - required: true - responses: - "200": - content: - application/json: - example: - data: - attributes: - driver: - estimation: - cpu: {max: 1500, p75: 1000, p95: 1200} - ephemeral_storage: 896 - heap: 6144 - memory: 7168 - overhead: 1024 - executor: - estimation: - cpu: {max: 2000, p75: 1200, p95: 1500} - ephemeral_storage: 512 - heap: 3072 - memory: 4096 - overhead: 1024 - matched_params: "detailed_metrics=false" - id: "dedupeactivecontexts:adp_dedupeactivecontexts_org2" - type: recommendation - schema: - $ref: "#/components/schemas/RecommendationDocument" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "403": - $ref: "#/components/responses/NotAuthorizedResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - AuthZ: [] - summary: Get SPA recommendations v2 - tags: - - Spa - x-unstable: |- - **Note**: This endpoint is in preview and may change in the future. It is not yet recommended for production use. - /api/v2/spa/recommendations/{service}: - get: - description: This endpoint is currently experimental and restricted to Datadog internal use only. Retrieve resource recommendations for a Spark job. The caller (Spark Gateway or DJM UI) provides a service name and SPA returns structured recommendations for driver and executor resources. The version with a shard should be preferred, where possible, as it gives more accurate results. - operationId: GetSPARecommendations - parameters: - - description: The recommendation service should not use its metrics cache. - in: query - name: bypass_cache - schema: - type: string - - description: The service name for a spark job. - in: path - name: service - required: true - schema: - type: string - responses: - "200": - content: - application/json: - example: - data: - attributes: - driver: - estimation: - cpu: {max: 1500, p75: 1000, p95: 1200} - ephemeral_storage: 896 - heap: 6144 - memory: 7168 - overhead: 1024 - executor: - estimation: - cpu: {max: 2000, p75: 1200, p95: 1500} - ephemeral_storage: 512 - heap: 3072 - memory: 4096 - overhead: 1024 - id: "dedupeactivecontexts:adp_dedupeactivecontexts_org2" - type: recommendation - schema: - $ref: "#/components/schemas/RecommendationDocument" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "403": - $ref: "#/components/responses/NotAuthorizedResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - AuthZ: [] - summary: Get SPA Recommendations - tags: - - Spa - x-unstable: |- - **Note**: This endpoint is in preview and may change in the future. It is not yet recommended for production use. - /api/v2/spa/recommendations/{service}/{shard}: - get: - description: This endpoint is currently experimental and restricted to Datadog internal use only. Retrieve resource recommendations for a Spark job. The caller (Spark Gateway or DJM UI) provides a service name and shard identifier, and SPA returns structured recommendations for driver and executor resources. - operationId: GetSPARecommendationsWithShard - parameters: - - description: The shard tag for a spark job, which differentiates jobs within the same service that have different resource needs - in: path - name: shard - required: true - schema: - type: string - - description: The service name for a spark job - in: path - name: service - required: true - schema: - type: string - - description: The recommendation service should not use its metrics cache. - in: query - name: bypass_cache - schema: - type: string - responses: - "200": - content: - application/json: - example: - data: - attributes: - driver: - estimation: - cpu: {max: 1500, p75: 1000, p95: 1200} - ephemeral_storage: 896 - heap: 6144 - memory: 7168 - overhead: 1024 - executor: - estimation: - cpu: {max: 2000, p75: 1200, p95: 1500} - ephemeral_storage: 512 - heap: 3072 - memory: 4096 - overhead: 1024 - id: "dedupeactivecontexts:adp_dedupeactivecontexts_org2" - type: recommendation - schema: - $ref: "#/components/schemas/RecommendationDocument" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "403": - $ref: "#/components/responses/NotAuthorizedResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - AuthZ: [] - summary: Get SPA Recommendations with a shard parameter - tags: - - Spa - x-unstable: |- - **Note**: This endpoint is in preview and may change in the future. It is not yet recommended for production use. /api/v2/spans/analytics/aggregate: post: description: |- @@ -249345,8 +249030,6 @@ tags: externalDocs: url: https://docs.datadoghq.com/service_catalog/service_definitions#metadata-schema-v30-beta name: Software Catalog - - description: SPA (Spark Pod Autosizing) API. Provides resource recommendations and cost insights to help optimize Spark job configurations. - name: Spa - description: |- Search and aggregate your spans from your Datadog platform over HTTP. name: Spans diff --git a/examples/v2/spa/GetSPARecommendations.rb b/examples/v2/spa/GetSPARecommendations.rb deleted file mode 100644 index 7a107108d3e0..000000000000 --- a/examples/v2/spa/GetSPARecommendations.rb +++ /dev/null @@ -1,9 +0,0 @@ -# Get SPA Recommendations returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.access_token = ENV["DD_BEARER_TOKEN"] - config.unstable_operations["v2.get_spa_recommendations".to_sym] = true -end -api_instance = DatadogAPIClient::V2::SpaAPI.new -p api_instance.get_spa_recommendations("service") diff --git a/examples/v2/spa/GetSPARecommendationsV2.rb b/examples/v2/spa/GetSPARecommendationsV2.rb deleted file mode 100644 index 9fd451ab615c..000000000000 --- a/examples/v2/spa/GetSPARecommendationsV2.rb +++ /dev/null @@ -1,20 +0,0 @@ -# Get SPA recommendations v2 returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.access_token = ENV["DD_BEARER_TOKEN"] - config.unstable_operations["v2.get_spa_recommendations_v2".to_sym] = true -end -api_instance = DatadogAPIClient::V2::SpaAPI.new - -body = DatadogAPIClient::V2::RecommendationV2RequestBody.new({ - data: DatadogAPIClient::V2::RecommendationV2RequestData.new({ - attributes: DatadogAPIClient::V2::RecommendationV2RequestAttributes.new({ - arguments: [ - "", - ], - }), - type: DatadogAPIClient::V2::RecommendationV2RequestType::RECOMMENDATION_V2_REQUEST, - }), -}) -p api_instance.get_spa_recommendations_v2("service", body) diff --git a/examples/v2/spa/GetSPARecommendationsWithShard.rb b/examples/v2/spa/GetSPARecommendationsWithShard.rb deleted file mode 100644 index 743d4d071f30..000000000000 --- a/examples/v2/spa/GetSPARecommendationsWithShard.rb +++ /dev/null @@ -1,9 +0,0 @@ -# Get SPA Recommendations with a shard parameter returns "OK" response - -require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.access_token = ENV["DD_BEARER_TOKEN"] - config.unstable_operations["v2.get_spa_recommendations_with_shard".to_sym] = true -end -api_instance = DatadogAPIClient::V2::SpaAPI.new -p api_instance.get_spa_recommendations_with_shard("shard", "service") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 1377d926590b..12e37d3df77c 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -6452,19 +6452,6 @@ "v2.CreateSnapshot" => { "body" => "CreateSnapshotRequest", }, - "v2.GetSPARecommendationsV2" => { - "service" => "String", - "body" => "RecommendationV2RequestBody", - }, - "v2.GetSPARecommendations" => { - "bypass_cache" => "String", - "service" => "String", - }, - "v2.GetSPARecommendationsWithShard" => { - "shard" => "String", - "service" => "String", - "bypass_cache" => "String", - }, "v2.AggregateSpans" => { "body" => "SpansAggregateRequest", }, diff --git a/features/v2/spa.feature b/features/v2/spa.feature deleted file mode 100644 index c175f767e9fc..000000000000 --- a/features/v2/spa.feature +++ /dev/null @@ -1,101 +0,0 @@ -@endpoint(spa) @endpoint(spa-v2) -Feature: Spa - SPA (Spark Pod Autosizing) API. Provides resource recommendations and cost - insights to help optimize Spark job configurations. - - Background: - Given an instance of "Spa" API - - @generated @skip @team:ddoghq/data-and-analytics-processing - Scenario: Get SPA Recommendations returns "Bad Request" response - Given operation "GetSPARecommendations" enabled - And new "GetSPARecommendations" request - And request contains "service" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:ddoghq/data-and-analytics-processing - Scenario: Get SPA Recommendations returns "OK" response - Given operation "GetSPARecommendations" enabled - And new "GetSPARecommendations" request - And request contains "service" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 200 OK - - @generated @skip @team:ddoghq/data-and-analytics-processing - Scenario: Get SPA Recommendations with a shard parameter returns "Bad Request" response - Given operation "GetSPARecommendationsWithShard" enabled - And new "GetSPARecommendationsWithShard" request - And request contains "shard" parameter from "REPLACE.ME" - And request contains "service" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:ddoghq/data-and-analytics-processing - Scenario: Get SPA Recommendations with a shard parameter returns "OK" response - Given operation "GetSPARecommendationsWithShard" enabled - And new "GetSPARecommendationsWithShard" request - And request contains "shard" parameter from "REPLACE.ME" - And request contains "service" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 200 OK - - @generated @skip @team:ddoghq/data-and-analytics-processing - Scenario: Get SPA recommendations v2 returns "Bad Request" response - Given operation "GetSPARecommendationsV2" enabled - And new "GetSPARecommendationsV2" request - And request contains "service" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"arguments": [""]}, "type": "recommendation_v2_request"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:ddoghq/data-and-analytics-processing - Scenario: Get SPA recommendations v2 returns "Not Found" response - Given operation "GetSPARecommendationsV2" enabled - And new "GetSPARecommendationsV2" request - And request contains "service" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"arguments": [""]}, "type": "recommendation_v2_request"}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:ddoghq/data-and-analytics-processing - Scenario: Get SPA recommendations v2 returns "OK" response - Given operation "GetSPARecommendationsV2" enabled - And new "GetSPARecommendationsV2" request - And request contains "service" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"arguments": [""]}, "type": "recommendation_v2_request"}} - When the request is sent - Then the response status is 200 OK - - @skip @team:ddoghq/data-and-analytics-processing - Scenario: GetSPARecommendations returns a JSON:API Recommendation with driver and executor estimations - Given new "GetSPARecommendations" request - And a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system - And operation "GetSPARecommendations" enabled - And request contains "service" parameter with value "dedupeactivecontexts" - And request contains "shard" parameter with value "adp_dedupeactivecontexts_org2" - When the request is sent - Then the response status is 404 Not Found - And the response "data.type" is equal to "recommendation" - And the response "data" has field "attributes" - And the response "data.attributes" has field "driver" - And the response "data.attributes" has field "executor" - And the response "data.attributes.driver" has field "estimation" - And the response "data.attributes.driver.estimation" has field "cpu" - And the response "data.attributes.driver.estimation" has field "memory" - And the response "data.attributes.driver.estimation" has field "ephemeral_storage" - And the response "data.attributes.driver.estimation" has field "heap" - And the response "data.attributes.driver.estimation" has field "overhead" - And the response "data.attributes.driver.estimation.cpu" has field "max" - And the response "data.attributes.driver.estimation.cpu" has field "p95" - And the response "data.attributes.driver.estimation.cpu" has field "p75" - And the response "data.attributes.executor" has field "estimation" - And the response "data.attributes.executor.estimation" has field "cpu" - And the response "data.attributes.executor.estimation" has field "memory" - And the response "data.attributes.executor.estimation" has field "ephemeral_storage" - And the response "data.attributes.executor.estimation" has field "heap" - And the response "data.attributes.executor.estimation" has field "overhead" - And the response "data.attributes.executor.estimation.cpu" has field "max" - And the response "data.attributes.executor.estimation.cpu" has field "p95" - And the response "data.attributes.executor.estimation.cpu" has field "p75" diff --git a/features/v2/undo.json b/features/v2/undo.json index 8b44c9415758..e121a0e357ff 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -9837,24 +9837,6 @@ "type": "unsafe" } }, - "GetSPARecommendationsV2": { - "tag": "Spa", - "undo": { - "type": "safe" - } - }, - "GetSPARecommendations": { - "tag": "Spa", - "undo": { - "type": "safe" - } - }, - "GetSPARecommendationsWithShard": { - "tag": "Spa", - "undo": { - "type": "safe" - } - }, "AggregateSpans": { "tag": "Spans", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 941ac5ce9f0f..7c3c7aa89784 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -779,9 +779,6 @@ def initialize "v2.get_slo_report_job_status": false, "v2.get_slo_status": false, "v2.create_snapshot": false, - "v2.get_spa_recommendations": false, - "v2.get_spa_recommendations_v2": false, - "v2.get_spa_recommendations_with_shard": false, "v2.create_ai_custom_rule": false, "v2.create_ai_custom_rule_revision": false, "v2.create_ai_custom_ruleset": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index b6deb90e82d8..33fa86a490bf 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2328,7 +2328,6 @@ def overrides "v2.component_grid_type" => "ComponentGridType", "v2.component_properties" => "ComponentProperties", "v2.component_properties_is_visible" => "ComponentPropertiesIsVisible", - "v2.component_recommendation" => "ComponentRecommendation", "v2.component_type" => "ComponentType", "v2.condition" => "Condition", "v2.condition_operator" => "ConditionOperator", @@ -2493,7 +2492,6 @@ def overrides "v2.coverage_summary_response" => "CoverageSummaryResponse", "v2.coverage_summary_service_stats" => "CoverageSummaryServiceStats", "v2.coverage_summary_type" => "CoverageSummaryType", - "v2.cpu" => "Cpu", "v2.create_action_connection_request" => "CreateActionConnectionRequest", "v2.create_action_connection_response" => "CreateActionConnectionResponse", "v2.create_allocations_request" => "CreateAllocationsRequest", @@ -3509,7 +3507,6 @@ def overrides "v2.escalation_target" => "EscalationTarget", "v2.escalation_targets" => "EscalationTargets", "v2.escalation_type" => "EscalationType", - "v2.estimation" => "Estimation", "v2.event" => "Event", "v2.event_attributes" => "EventAttributes", "v2.event_category" => "EventCategory", @@ -7054,9 +7051,6 @@ def overrides "v2.readiness_gate" => "ReadinessGate", "v2.readiness_gate_threshold_type" => "ReadinessGateThresholdType", "v2.recently_updated_entities_response" => "RecentlyUpdatedEntitiesResponse", - "v2.recommendation_attributes" => "RecommendationAttributes", - "v2.recommendation_data" => "RecommendationData", - "v2.recommendation_document" => "RecommendationDocument", "v2.recommendations_filter_request" => "RecommendationsFilterRequest", "v2.recommendations_filter_request_data" => "RecommendationsFilterRequestData", "v2.recommendations_filter_request_data_attributes" => "RecommendationsFilterRequestDataAttributes", @@ -7065,11 +7059,6 @@ def overrides "v2.recommendations_filter_request_sort_items" => "RecommendationsFilterRequestSortItems", "v2.recommendations_page_meta" => "RecommendationsPageMeta", "v2.recommendations_page_meta_page" => "RecommendationsPageMetaPage", - "v2.recommendation_type" => "RecommendationType", - "v2.recommendation_v2_request_attributes" => "RecommendationV2RequestAttributes", - "v2.recommendation_v2_request_body" => "RecommendationV2RequestBody", - "v2.recommendation_v2_request_data" => "RecommendationV2RequestData", - "v2.recommendation_v2_request_type" => "RecommendationV2RequestType", "v2.reference_table_create_source_type" => "ReferenceTableCreateSourceType", "v2.reference_table_schema_field_type" => "ReferenceTableSchemaFieldType", "v2.reference_table_sort_type" => "ReferenceTableSortType", @@ -9780,7 +9769,6 @@ def overrides "v2.slack_integration_api" => "SlackIntegrationAPI", "v2.snowflake_integration_api" => "SnowflakeIntegrationAPI", "v2.software_catalog_api" => "SoftwareCatalogAPI", - "v2.spa_api" => "SpaAPI", "v2.spans_api" => "SpansAPI", "v2.spans_metrics_api" => "SpansMetricsAPI", "v2.static_analysis_api" => "StaticAnalysisAPI", diff --git a/lib/datadog_api_client/v2/api/spa_api.rb b/lib/datadog_api_client/v2/api/spa_api.rb deleted file mode 100644 index 81385fcb73cc..000000000000 --- a/lib/datadog_api_client/v2/api/spa_api.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'cgi' - -module DatadogAPIClient::V2 - class SpaAPI - attr_accessor :api_client - - def initialize(api_client = DatadogAPIClient::APIClient.default) - @api_client = api_client - end - - # Get SPA Recommendations. - # - # @see #get_spa_recommendations_with_http_info - def get_spa_recommendations(service, opts = {}) - data, _status_code, _headers = get_spa_recommendations_with_http_info(service, opts) - data - end - - # Get SPA Recommendations. - # - # This endpoint is currently experimental and restricted to Datadog internal use only. Retrieve resource recommendations for a Spark job. The caller (Spark Gateway or DJM UI) provides a service name and SPA returns structured recommendations for driver and executor resources. The version with a shard should be preferred, where possible, as it gives more accurate results. - # - # @param service [String] The service name for a spark job. - # @param opts [Hash] the optional parameters - # @option opts [String] :bypass_cache The recommendation service should not use its metrics cache. - # @return [Array<(RecommendationDocument, Integer, Hash)>] RecommendationDocument data, response status code and response headers - def get_spa_recommendations_with_http_info(service, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_spa_recommendations".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_spa_recommendations") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_spa_recommendations")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SpaAPI.get_spa_recommendations ...' - end - # verify the required parameter 'service' is set - if @api_client.config.client_side_validation && service.nil? - fail ArgumentError, "Missing the required parameter 'service' when calling SpaAPI.get_spa_recommendations" - end - # resource path - local_var_path = '/api/v2/spa/recommendations/{service}'.sub('{service}', CGI.escape(service.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'bypass_cache'] = opts[:'bypass_cache'] if !opts[:'bypass_cache'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'RecommendationDocument' - - # auth_names - auth_names = opts[:debug_auth_names] || [:AuthZ] - - new_options = opts.merge( - :operation => :get_spa_recommendations, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type, - :api_version => "V2" - ) - - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SpaAPI#get_spa_recommendations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get SPA recommendations v2. - # - # @see #get_spa_recommendations_v2_with_http_info - def get_spa_recommendations_v2(service, body, opts = {}) - data, _status_code, _headers = get_spa_recommendations_v2_with_http_info(service, body, opts) - data - end - - # Get SPA recommendations v2. - # - # This endpoint is experimental and restricted to Datadog internal use only. - # Retrieve resource recommendations for a Spark job. The caller (Spark Gateway) provides - # a service name and the job's raw arguments. SPA determines which arguments are relevant - # for the service and returns structured recommendations for driver and executor resources. - # - # @param service [String] The service name for a Spark job - # @param body [RecommendationV2RequestBody] - # @param opts [Hash] the optional parameters - # @return [Array<(RecommendationDocument, Integer, Hash)>] RecommendationDocument data, response status code and response headers - def get_spa_recommendations_v2_with_http_info(service, body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_spa_recommendations_v2".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_spa_recommendations_v2") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_spa_recommendations_v2")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SpaAPI.get_spa_recommendations_v2 ...' - end - # verify the required parameter 'service' is set - if @api_client.config.client_side_validation && service.nil? - fail ArgumentError, "Missing the required parameter 'service' when calling SpaAPI.get_spa_recommendations_v2" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling SpaAPI.get_spa_recommendations_v2" - end - # resource path - local_var_path = '/api/v2/spa/recommendations-v2/{service}'.sub('{service}', CGI.escape(service.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'RecommendationDocument' - - # auth_names - auth_names = opts[:debug_auth_names] || [:AuthZ] - - new_options = opts.merge( - :operation => :get_spa_recommendations_v2, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type, - :api_version => "V2" - ) - - data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SpaAPI#get_spa_recommendations_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get SPA Recommendations with a shard parameter. - # - # @see #get_spa_recommendations_with_shard_with_http_info - def get_spa_recommendations_with_shard(shard, service, opts = {}) - data, _status_code, _headers = get_spa_recommendations_with_shard_with_http_info(shard, service, opts) - data - end - - # Get SPA Recommendations with a shard parameter. - # - # This endpoint is currently experimental and restricted to Datadog internal use only. Retrieve resource recommendations for a Spark job. The caller (Spark Gateway or DJM UI) provides a service name and shard identifier, and SPA returns structured recommendations for driver and executor resources. - # - # @param shard [String] The shard tag for a spark job, which differentiates jobs within the same service that have different resource needs - # @param service [String] The service name for a spark job - # @param opts [Hash] the optional parameters - # @option opts [String] :bypass_cache The recommendation service should not use its metrics cache. - # @return [Array<(RecommendationDocument, Integer, Hash)>] RecommendationDocument data, response status code and response headers - def get_spa_recommendations_with_shard_with_http_info(shard, service, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_spa_recommendations_with_shard".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_spa_recommendations_with_shard") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_spa_recommendations_with_shard")) - end - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SpaAPI.get_spa_recommendations_with_shard ...' - end - # verify the required parameter 'shard' is set - if @api_client.config.client_side_validation && shard.nil? - fail ArgumentError, "Missing the required parameter 'shard' when calling SpaAPI.get_spa_recommendations_with_shard" - end - # verify the required parameter 'service' is set - if @api_client.config.client_side_validation && service.nil? - fail ArgumentError, "Missing the required parameter 'service' when calling SpaAPI.get_spa_recommendations_with_shard" - end - # resource path - local_var_path = '/api/v2/spa/recommendations/{service}/{shard}'.sub('{shard}', CGI.escape(shard.to_s).gsub('%2F', '/')).sub('{service}', CGI.escape(service.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'bypass_cache'] = opts[:'bypass_cache'] if !opts[:'bypass_cache'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'RecommendationDocument' - - # auth_names - auth_names = opts[:debug_auth_names] || [:AuthZ] - - new_options = opts.merge( - :operation => :get_spa_recommendations_with_shard, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type, - :api_version => "V2" - ) - - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: SpaAPI#get_spa_recommendations_with_shard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/lib/datadog_api_client/v2/models/component_recommendation.rb b/lib/datadog_api_client/v2/models/component_recommendation.rb deleted file mode 100644 index 0c941f40d4e5..000000000000 --- a/lib/datadog_api_client/v2/models/component_recommendation.rb +++ /dev/null @@ -1,123 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Resource recommendation for a single Spark component (driver or executor). Contains estimation data used to patch Spark job specs. - class ComponentRecommendation - include BaseGenericModel - - # Recommended resource values for a Spark driver or executor, derived from recent real usage metrics. Used by SPA to propose more efficient pod sizing. - attr_reader :estimation - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'estimation' => :'estimation' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'estimation' => :'Estimation' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ComponentRecommendation` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'estimation') - self.estimation = attributes[:'estimation'] - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @estimation.nil? - true - end - - # Custom attribute writer method with validation - # @param estimation [Object] Object to be assigned - # @!visibility private - def estimation=(estimation) - if estimation.nil? - fail ArgumentError, 'invalid value for "estimation", estimation cannot be nil.' - end - @estimation = estimation - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - estimation == o.estimation && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [estimation, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/cpu.rb b/lib/datadog_api_client/v2/models/cpu.rb deleted file mode 100644 index ba58559d69f6..000000000000 --- a/lib/datadog_api_client/v2/models/cpu.rb +++ /dev/null @@ -1,125 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # CPU usage statistics derived from historical Spark job metrics. Provides multiple estimates so users can choose between conservative and cost-saving risk profiles. - class Cpu - include BaseGenericModel - - # Maximum CPU usage observed for the job, expressed in millicores. This represents the upper bound of usage. - attr_accessor :max - - # 75th percentile of CPU usage (millicores). Represents a cost-saving configuration while covering most workloads. - attr_accessor :p75 - - # 95th percentile of CPU usage (millicores). Balances performance and cost, providing a safer margin than p75. - attr_accessor :p95 - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'max' => :'max', - :'p75' => :'p75', - :'p95' => :'p95' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'max' => :'Integer', - :'p75' => :'Integer', - :'p95' => :'Integer' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::Cpu` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'max') - self.max = attributes[:'max'] - end - - if attributes.key?(:'p75') - self.p75 = attributes[:'p75'] - end - - if attributes.key?(:'p95') - self.p95 = attributes[:'p95'] - end - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - max == o.max && - p75 == o.p75 && - p95 == o.p95 && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [max, p75, p95, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/estimation.rb b/lib/datadog_api_client/v2/models/estimation.rb deleted file mode 100644 index 3c62834ee6d7..000000000000 --- a/lib/datadog_api_client/v2/models/estimation.rb +++ /dev/null @@ -1,145 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Recommended resource values for a Spark driver or executor, derived from recent real usage metrics. Used by SPA to propose more efficient pod sizing. - class Estimation - include BaseGenericModel - - # CPU usage statistics derived from historical Spark job metrics. Provides multiple estimates so users can choose between conservative and cost-saving risk profiles. - attr_accessor :cpu - - # Recommended ephemeral storage allocation (in MiB). Derived from job temporary storage patterns. - attr_accessor :ephemeral_storage - - # Recommended JVM heap size (in MiB). - attr_accessor :heap - - # Recommended total memory allocation (in MiB). Includes both heap and overhead. - attr_accessor :memory - - # Recommended JVM overhead (in MiB). Computed as total memory - heap. - attr_accessor :overhead - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'cpu' => :'cpu', - :'ephemeral_storage' => :'ephemeral_storage', - :'heap' => :'heap', - :'memory' => :'memory', - :'overhead' => :'overhead' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'cpu' => :'Cpu', - :'ephemeral_storage' => :'Integer', - :'heap' => :'Integer', - :'memory' => :'Integer', - :'overhead' => :'Integer' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::Estimation` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'cpu') - self.cpu = attributes[:'cpu'] - end - - if attributes.key?(:'ephemeral_storage') - self.ephemeral_storage = attributes[:'ephemeral_storage'] - end - - if attributes.key?(:'heap') - self.heap = attributes[:'heap'] - end - - if attributes.key?(:'memory') - self.memory = attributes[:'memory'] - end - - if attributes.key?(:'overhead') - self.overhead = attributes[:'overhead'] - end - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - cpu == o.cpu && - ephemeral_storage == o.ephemeral_storage && - heap == o.heap && - memory == o.memory && - overhead == o.overhead && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [cpu, ephemeral_storage, heap, memory, overhead, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/recommendation_attributes.rb b/lib/datadog_api_client/v2/models/recommendation_attributes.rb deleted file mode 100644 index 9c9f76032e3e..000000000000 --- a/lib/datadog_api_client/v2/models/recommendation_attributes.rb +++ /dev/null @@ -1,165 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Attributes of the SPA Recommendation resource. Contains recommendations for both driver and executor components. - class RecommendationAttributes - include BaseGenericModel - - # The confidence level of the recommendation, expressed as a value between 0.0 (low confidence) and 1.0 (high confidence). - attr_accessor :confidence_level - - # Resource recommendation for a single Spark component (driver or executor). Contains estimation data used to patch Spark job specs. - attr_reader :driver - - # Resource recommendation for a single Spark component (driver or executor). Contains estimation data used to patch Spark job specs. - attr_reader :executor - - # Only returned by the v2 endpoint. The job parameters whose values the recommendation was matched on, as `parameter=value` pairs joined by `|`. - # An empty string means the service-wide (coarse) recommendation was used. - attr_accessor :matched_params - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'confidence_level' => :'confidence_level', - :'driver' => :'driver', - :'executor' => :'executor', - :'matched_params' => :'matched_params' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'confidence_level' => :'Float', - :'driver' => :'ComponentRecommendation', - :'executor' => :'ComponentRecommendation', - :'matched_params' => :'String' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RecommendationAttributes` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'confidence_level') - self.confidence_level = attributes[:'confidence_level'] - end - - if attributes.key?(:'driver') - self.driver = attributes[:'driver'] - end - - if attributes.key?(:'executor') - self.executor = attributes[:'executor'] - end - - if attributes.key?(:'matched_params') - self.matched_params = attributes[:'matched_params'] - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @driver.nil? - return false if @executor.nil? - true - end - - # Custom attribute writer method with validation - # @param driver [Object] Object to be assigned - # @!visibility private - def driver=(driver) - if driver.nil? - fail ArgumentError, 'invalid value for "driver", driver cannot be nil.' - end - @driver = driver - end - - # Custom attribute writer method with validation - # @param executor [Object] Object to be assigned - # @!visibility private - def executor=(executor) - if executor.nil? - fail ArgumentError, 'invalid value for "executor", executor cannot be nil.' - end - @executor = executor - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - confidence_level == o.confidence_level && - driver == o.driver && - executor == o.executor && - matched_params == o.matched_params && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [confidence_level, driver, executor, matched_params, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/recommendation_data.rb b/lib/datadog_api_client/v2/models/recommendation_data.rb deleted file mode 100644 index 134c91af2366..000000000000 --- a/lib/datadog_api_client/v2/models/recommendation_data.rb +++ /dev/null @@ -1,154 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # JSON:API resource object for SPA Recommendation. Includes type, optional ID, and resource attributes with structured recommendations. - class RecommendationData - include BaseGenericModel - - # Attributes of the SPA Recommendation resource. Contains recommendations for both driver and executor components. - attr_reader :attributes - - # Resource identifier for the recommendation. Optional in responses. - attr_accessor :id - - # JSON:API resource type for Spark Pod Autosizing recommendations. Identifies the Recommendation resource returned by SPA. - attr_reader :type - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'attributes' => :'attributes', - :'id' => :'id', - :'type' => :'type' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'attributes' => :'RecommendationAttributes', - :'id' => :'String', - :'type' => :'RecommendationType' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RecommendationData` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'attributes') - self.attributes = attributes[:'attributes'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @attributes.nil? - return false if @type.nil? - true - end - - # Custom attribute writer method with validation - # @param attributes [Object] Object to be assigned - # @!visibility private - def attributes=(attributes) - if attributes.nil? - fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' - end - @attributes = attributes - end - - # Custom attribute writer method with validation - # @param type [Object] Object to be assigned - # @!visibility private - def type=(type) - if type.nil? - fail ArgumentError, 'invalid value for "type", type cannot be nil.' - end - @type = type - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - attributes == o.attributes && - id == o.id && - type == o.type && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [attributes, id, type, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/recommendation_document.rb b/lib/datadog_api_client/v2/models/recommendation_document.rb deleted file mode 100644 index 15c5403af0df..000000000000 --- a/lib/datadog_api_client/v2/models/recommendation_document.rb +++ /dev/null @@ -1,123 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # JSON:API document containing a single Recommendation resource. Returned by SPA when the Spark Gateway requests recommendations. - class RecommendationDocument - include BaseGenericModel - - # JSON:API resource object for SPA Recommendation. Includes type, optional ID, and resource attributes with structured recommendations. - attr_reader :data - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'data' => :'data' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'data' => :'RecommendationData' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RecommendationDocument` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @data.nil? - true - end - - # Custom attribute writer method with validation - # @param data [Object] Object to be assigned - # @!visibility private - def data=(data) - if data.nil? - fail ArgumentError, 'invalid value for "data", data cannot be nil.' - end - @data = data - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - data == o.data && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [data, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/recommendation_type.rb b/lib/datadog_api_client/v2/models/recommendation_type.rb deleted file mode 100644 index 96b4e691e380..000000000000 --- a/lib/datadog_api_client/v2/models/recommendation_type.rb +++ /dev/null @@ -1,26 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # JSON:API resource type for Spark Pod Autosizing recommendations. Identifies the Recommendation resource returned by SPA. - class RecommendationType - include BaseEnumModel - - RECOMMENDATION = "recommendation".freeze - end -end diff --git a/lib/datadog_api_client/v2/models/recommendation_v2_request_attributes.rb b/lib/datadog_api_client/v2/models/recommendation_v2_request_attributes.rb deleted file mode 100644 index f3f008c12eca..000000000000 --- a/lib/datadog_api_client/v2/models/recommendation_v2_request_attributes.rb +++ /dev/null @@ -1,127 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Attributes for requesting SPA recommendations by forwarding a Spark job's raw arguments - # instead of a pre-computed shard. - class RecommendationV2RequestAttributes - include BaseGenericModel - - # Raw, unfiltered Spark job arguments as submitted (for example, `--org_id=2`). - # SPA determines which arguments are relevant for the given service. - attr_reader :arguments - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'arguments' => :'arguments' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'arguments' => :'Array' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RecommendationV2RequestAttributes` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'arguments') - if (value = attributes[:'arguments']).is_a?(Array) - self.arguments = value - end - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @arguments.nil? - true - end - - # Custom attribute writer method with validation - # @param arguments [Object] Object to be assigned - # @!visibility private - def arguments=(arguments) - if arguments.nil? - fail ArgumentError, 'invalid value for "arguments", arguments cannot be nil.' - end - @arguments = arguments - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - arguments == o.arguments && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [arguments, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/recommendation_v2_request_body.rb b/lib/datadog_api_client/v2/models/recommendation_v2_request_body.rb deleted file mode 100644 index 9f8c79db5375..000000000000 --- a/lib/datadog_api_client/v2/models/recommendation_v2_request_body.rb +++ /dev/null @@ -1,124 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Request body for retrieving SPA recommendations by forwarding a Spark job's raw arguments - # instead of a pre-computed shard. - class RecommendationV2RequestBody - include BaseGenericModel - - # JSON:API resource object for the SPA v2 recommendation request. - attr_reader :data - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'data' => :'data' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'data' => :'RecommendationV2RequestData' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RecommendationV2RequestBody` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @data.nil? - true - end - - # Custom attribute writer method with validation - # @param data [Object] Object to be assigned - # @!visibility private - def data=(data) - if data.nil? - fail ArgumentError, 'invalid value for "data", data cannot be nil.' - end - @data = data - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - data == o.data && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [data, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/recommendation_v2_request_data.rb b/lib/datadog_api_client/v2/models/recommendation_v2_request_data.rb deleted file mode 100644 index 88a62019eaeb..000000000000 --- a/lib/datadog_api_client/v2/models/recommendation_v2_request_data.rb +++ /dev/null @@ -1,145 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # JSON:API resource object for the SPA v2 recommendation request. - class RecommendationV2RequestData - include BaseGenericModel - - # Attributes for requesting SPA recommendations by forwarding a Spark job's raw arguments - # instead of a pre-computed shard. - attr_reader :attributes - - # JSON:API resource type for the SPA v2 recommendation request. - attr_reader :type - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'attributes' => :'attributes', - :'type' => :'type' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'attributes' => :'RecommendationV2RequestAttributes', - :'type' => :'RecommendationV2RequestType' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RecommendationV2RequestData` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'attributes') - self.attributes = attributes[:'attributes'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @attributes.nil? - return false if @type.nil? - true - end - - # Custom attribute writer method with validation - # @param attributes [Object] Object to be assigned - # @!visibility private - def attributes=(attributes) - if attributes.nil? - fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' - end - @attributes = attributes - end - - # Custom attribute writer method with validation - # @param type [Object] Object to be assigned - # @!visibility private - def type=(type) - if type.nil? - fail ArgumentError, 'invalid value for "type", type cannot be nil.' - end - @type = type - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - attributes == o.attributes && - type == o.type && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [attributes, type, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/recommendation_v2_request_type.rb b/lib/datadog_api_client/v2/models/recommendation_v2_request_type.rb deleted file mode 100644 index ecb2ea6e41c7..000000000000 --- a/lib/datadog_api_client/v2/models/recommendation_v2_request_type.rb +++ /dev/null @@ -1,26 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # JSON:API resource type for the SPA v2 recommendation request. - class RecommendationV2RequestType - include BaseEnumModel - - RECOMMENDATION_V2_REQUEST = "recommendation_v2_request".freeze - end -end