Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ci-pipeline-fingerprints field in v2.2 #1768

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-03-13 19:22:36.703012",
"spec_repo_commit": "5745e5bb"
"regenerated": "2024-03-14 19:01:46.365230",
"spec_repo_commit": "0197a1bb"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-03-13 19:22:36.718532",
"spec_repo_commit": "5745e5bb"
"regenerated": "2024-03-14 19:01:46.389657",
"spec_repo_commit": "0197a1bb"
}
}
}
8 changes: 8 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19683,6 +19683,14 @@ components:
feature, which the service is a part of.
example: my-app
type: string
ci-pipeline-fingerprints:
description: A set of CI fingerprints.
example:
- j88xdEy0J5lc
- eZ7LMljCk8vo
items:
type: string
type: array
contacts:
description: A list of contacts related to the services.
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

body = DatadogAPIClient::V2::ServiceDefinitionV2Dot2.new({
application: "my-app",
ci_pipeline_fingerprints: [
"j88xdEy0J5lc",
"eZ7LMljCk8vo",
],
contacts: [
DatadogAPIClient::V2::ServiceDefinitionV2Dot2Contact.new({
contact: "https://teams.microsoft.com/myteam",
Expand Down
6 changes: 3 additions & 3 deletions features/v2/service_definition.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ Feature: Service Definition
@generated @skip @team:DataDog/service-catalog
Scenario: Create or update service definition returns "Bad Request" response
Given new "CreateOrUpdateServiceDefinitions" request
And body with value {"application": "my-app", "contacts": [{"contact": "https://teams.microsoft.com/myteam", "name": "My team channel", "type": "slack"}], "dd-service": "my-service", "description": "My service description", "extensions": {"myorg/extension": "extensionValue"}, "integrations": {"opsgenie": {"region": "US", "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"}, "pagerduty": {"service-url": "https://my-org.pagerduty.com/service-directory/PMyService"}}, "languages": ["dotnet", "go", "java", "js", "php", "python", "ruby", "c++"], "lifecycle": "sandbox", "links": [{"name": "Runbook", "provider": "Github", "type": "runbook", "url": "https://my-runbook"}], "schema-version": "v2.2", "tags": ["my:tag", "service:tag"], "team": "my-team", "tier": "High", "type": "web"}
And body with value {"application": "my-app", "ci-pipeline-fingerprints": ["j88xdEy0J5lc", "eZ7LMljCk8vo"], "contacts": [{"contact": "https://teams.microsoft.com/myteam", "name": "My team channel", "type": "slack"}], "dd-service": "my-service", "description": "My service description", "extensions": {"myorg/extension": "extensionValue"}, "integrations": {"opsgenie": {"region": "US", "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"}, "pagerduty": {"service-url": "https://my-org.pagerduty.com/service-directory/PMyService"}}, "languages": ["dotnet", "go", "java", "js", "php", "python", "ruby", "c++"], "lifecycle": "sandbox", "links": [{"name": "Runbook", "provider": "Github", "type": "runbook", "url": "https://my-runbook"}], "schema-version": "v2.2", "tags": ["my:tag", "service:tag"], "team": "my-team", "tier": "High", "type": "web"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/service-catalog
Scenario: Create or update service definition returns "CREATED" response
Given new "CreateOrUpdateServiceDefinitions" request
And body with value {"application": "my-app", "contacts": [{"contact": "https://teams.microsoft.com/myteam", "name": "My team channel", "type": "slack"}], "dd-service": "my-service", "description": "My service description", "extensions": {"myorg/extension": "extensionValue"}, "integrations": {"opsgenie": {"region": "US", "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"}, "pagerduty": {"service-url": "https://my-org.pagerduty.com/service-directory/PMyService"}}, "languages": ["dotnet", "go", "java", "js", "php", "python", "ruby", "c++"], "lifecycle": "sandbox", "links": [{"name": "Runbook", "provider": "Github", "type": "runbook", "url": "https://my-runbook"}], "schema-version": "v2.2", "tags": ["my:tag", "service:tag"], "team": "my-team", "tier": "High", "type": "web"}
And body with value {"application": "my-app", "ci-pipeline-fingerprints": ["j88xdEy0J5lc", "eZ7LMljCk8vo"], "contacts": [{"contact": "https://teams.microsoft.com/myteam", "name": "My team channel", "type": "slack"}], "dd-service": "my-service", "description": "My service description", "extensions": {"myorg/extension": "extensionValue"}, "integrations": {"opsgenie": {"region": "US", "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"}, "pagerduty": {"service-url": "https://my-org.pagerduty.com/service-directory/PMyService"}}, "languages": ["dotnet", "go", "java", "js", "php", "python", "ruby", "c++"], "lifecycle": "sandbox", "links": [{"name": "Runbook", "provider": "Github", "type": "runbook", "url": "https://my-runbook"}], "schema-version": "v2.2", "tags": ["my:tag", "service:tag"], "team": "my-team", "tier": "High", "type": "web"}
When the request is sent
Then the response status is 200 CREATED

@generated @skip @team:DataDog/service-catalog
Scenario: Create or update service definition returns "Conflict" response
Given new "CreateOrUpdateServiceDefinitions" request
And body with value {"application": "my-app", "contacts": [{"contact": "https://teams.microsoft.com/myteam", "name": "My team channel", "type": "slack"}], "dd-service": "my-service", "description": "My service description", "extensions": {"myorg/extension": "extensionValue"}, "integrations": {"opsgenie": {"region": "US", "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"}, "pagerduty": {"service-url": "https://my-org.pagerduty.com/service-directory/PMyService"}}, "languages": ["dotnet", "go", "java", "js", "php", "python", "ruby", "c++"], "lifecycle": "sandbox", "links": [{"name": "Runbook", "provider": "Github", "type": "runbook", "url": "https://my-runbook"}], "schema-version": "v2.2", "tags": ["my:tag", "service:tag"], "team": "my-team", "tier": "High", "type": "web"}
And body with value {"application": "my-app", "ci-pipeline-fingerprints": ["j88xdEy0J5lc", "eZ7LMljCk8vo"], "contacts": [{"contact": "https://teams.microsoft.com/myteam", "name": "My team channel", "type": "slack"}], "dd-service": "my-service", "description": "My service description", "extensions": {"myorg/extension": "extensionValue"}, "integrations": {"opsgenie": {"region": "US", "service-url": "https://my-org.opsgenie.com/service/123e4567-e89b-12d3-a456-426614174000"}, "pagerduty": {"service-url": "https://my-org.pagerduty.com/service-directory/PMyService"}}, "languages": ["dotnet", "go", "java", "js", "php", "python", "ruby", "c++"], "lifecycle": "sandbox", "links": [{"name": "Runbook", "provider": "Github", "type": "runbook", "url": "https://my-runbook"}], "schema-version": "v2.2", "tags": ["my:tag", "service:tag"], "team": "my-team", "tier": "High", "type": "web"}
When the request is sent
Then the response status is 409 Conflict

Expand Down
14 changes: 13 additions & 1 deletion lib/datadog_api_client/v2/models/service_definition_v2_dot2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class ServiceDefinitionV2Dot2
# Identifier for a group of related services serving a product feature, which the service is a part of.
attr_accessor :application

# A set of CI fingerprints.
attr_accessor :ci_pipeline_fingerprints

# A list of contacts related to the services.
attr_accessor :contacts

Expand Down Expand Up @@ -68,6 +71,7 @@ class ServiceDefinitionV2Dot2
def self.attribute_map
{
:'application' => :'application',
:'ci_pipeline_fingerprints' => :'ci-pipeline-fingerprints',
:'contacts' => :'contacts',
:'dd_service' => :'dd-service',
:'description' => :'description',
Expand All @@ -89,6 +93,7 @@ def self.attribute_map
def self.openapi_types
{
:'application' => :'String',
:'ci_pipeline_fingerprints' => :'Array<String>',
:'contacts' => :'Array<ServiceDefinitionV2Dot2Contact>',
:'dd_service' => :'String',
:'description' => :'String',
Expand Down Expand Up @@ -125,6 +130,12 @@ def initialize(attributes = {})
self.application = attributes[:'application']
end

if attributes.key?(:'ci_pipeline_fingerprints')
if (value = attributes[:'ci_pipeline_fingerprints']).is_a?(Array)
self.ci_pipeline_fingerprints = value
end
end

if attributes.key?(:'contacts')
if (value = attributes[:'contacts']).is_a?(Array)
self.contacts = value
Expand Down Expand Up @@ -222,6 +233,7 @@ def ==(o)
return true if self.equal?(o)
self.class == o.class &&
application == o.application &&
ci_pipeline_fingerprints == o.ci_pipeline_fingerprints &&
contacts == o.contacts &&
dd_service == o.dd_service &&
description == o.description &&
Expand All @@ -241,7 +253,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[application, contacts, dd_service, description, extensions, integrations, languages, lifecycle, links, schema_version, tags, team, tier, type].hash
[application, ci_pipeline_fingerprints, contacts, dd_service, description, extensions, integrations, languages, lifecycle, links, schema_version, tags, team, tier, type].hash
end
end
end
Loading