Skip to content
Open
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
285 changes: 285 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,13 @@ components:
required: true
schema:
type: string
OpsgenieAccountIDPathParameter:
description: The UUID of the Opsgenie account.
in: path
name: account_id
required: true
schema:
type: string
OpsgenieServiceIDPathParameter:
description: The UUID of the service.
in: path
Expand Down Expand Up @@ -61684,6 +61691,129 @@ components:
format: binary
type: string
type: object
OpsgenieAccountCreateAttributes:
description: The Opsgenie account attributes for a create request.
properties:
api_key:
description: The Opsgenie API key for your Opsgenie account.
example: "00000000-0000-0000-0000-000000000000"
minLength: 1
type: string
region:
$ref: "#/components/schemas/OpsgenieServiceRegionType"
required:
- api_key
- region
type: object
OpsgenieAccountCreateData:
description: Opsgenie account data for a create request.
properties:
attributes:
$ref: "#/components/schemas/OpsgenieAccountCreateAttributes"
type:
$ref: "#/components/schemas/OpsgenieAccountType"
required:
- type
- attributes
type: object
OpsgenieAccountCreateRequest:
description: Create request for an Opsgenie account.
properties:
data:
$ref: "#/components/schemas/OpsgenieAccountCreateData"
required:
- data
type: object
OpsgenieAccountResponse:
description: Response containing an Opsgenie account.
properties:
data:
$ref: "#/components/schemas/OpsgenieAccountResponseData"
required:
- data
type: object
OpsgenieAccountResponseAttributes:
description: The attributes from an Opsgenie account response.
properties:
region:
$ref: "#/components/schemas/OpsgenieServiceRegionType"
type: object
OpsgenieAccountResponseData:
description: Opsgenie account data from a response.
properties:
attributes:
$ref: "#/components/schemas/OpsgenieAccountResponseAttributes"
id:
description: The ID of the Opsgenie account.
example: "596da4af-0563-4097-90ff-07230c3f9db3"
maxLength: 100
minLength: 1
type: string
type:
$ref: "#/components/schemas/OpsgenieAccountType"
required:
- id
- type
- attributes
type: object
OpsgenieAccountType:
default: opsgenie-account
description: Opsgenie account resource type.
enum:
- opsgenie-account
example: opsgenie-account
type: string
x-enum-varnames:
- OPSGENIE_ACCOUNT
OpsgenieAccountUpdateAttributes:
description: The Opsgenie account attributes for an update request.
properties:
api_key:
description: The Opsgenie API key for your Opsgenie account.
example: "00000000-0000-0000-0000-000000000000"
minLength: 1
type: string
region:
$ref: "#/components/schemas/OpsgenieServiceRegionType"
type: object
OpsgenieAccountUpdateData:
description: Opsgenie account data for an update request.
properties:
attributes:
$ref: "#/components/schemas/OpsgenieAccountUpdateAttributes"
id:
description: The ID of the Opsgenie account.
example: "596da4af-0563-4097-90ff-07230c3f9db3"
maxLength: 100
minLength: 1
type: string
type:
$ref: "#/components/schemas/OpsgenieAccountType"
required:
- id
- type
- attributes
type: object
OpsgenieAccountUpdateRequest:
description: Update request for an Opsgenie account.
properties:
data:
$ref: "#/components/schemas/OpsgenieAccountUpdateData"
required:
- data
type: object
OpsgenieAccountsResponse:
description: Response with a list of Opsgenie accounts.
properties:
data:
description: An array of Opsgenie accounts.
example: [{"attributes": {"region": "us"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "opsgenie-account"}, {"attributes": {"region": "eu"}, "id": "0d2937f1-b561-44fa-914a-99910f848014", "type": "opsgenie-account"}]
items:
$ref: "#/components/schemas/OpsgenieAccountResponseData"
type: array
required:
- data
type: object
OpsgenieServiceCreateAttributes:
description: The Opsgenie service attributes for a create request.
properties:
Expand Down Expand Up @@ -124953,6 +125083,161 @@ paths:
summary: Update tenancy config
tags:
- OCI Integration
/api/v2/integration/opsgenie/accounts:
get:
description: Get a list of all Opsgenie accounts from the Datadog Opsgenie integration.
operationId: ListOpsgenieAccounts
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
- attributes:
region: us
id: 00000000-0000-0000-0000-000000000001
type: opsgenie-account
schema:
$ref: "#/components/schemas/OpsgenieAccountsResponse"
description: OK
"403":
$ref: "#/components/responses/ForbiddenResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
summary: Get all Opsgenie accounts
tags:
- Opsgenie Integration
"x-permission":
operator: OR
permissions:
- integrations_read
post:
description: Create a new Opsgenie account in the Datadog Opsgenie integration.
operationId: CreateOpsgenieAccount
requestBody:
content:
application/json:
examples:
default:
value:
data:
attributes:
api_key: 00000000-0000-0000-0000-000000000000
region: us
type: opsgenie-account
schema:
$ref: "#/components/schemas/OpsgenieAccountCreateRequest"
description: Opsgenie account payload.
required: true
responses:
"201":
content:
application/json:
examples:
default:
value:
data:
attributes:
region: us
id: 00000000-0000-0000-0000-000000000002
type: opsgenie-account
schema:
$ref: "#/components/schemas/OpsgenieAccountResponse"
description: CREATED
"400":
$ref: "#/components/responses/BadRequestResponse"
"403":
$ref: "#/components/responses/ForbiddenResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
summary: Create a new Opsgenie account
tags:
- Opsgenie Integration
x-codegen-request-body-name: body
"x-permission":
operator: OR
permissions:
- manage_integrations
/api/v2/integration/opsgenie/accounts/{account_id}:
delete:
description: Delete a single Opsgenie account from the Datadog Opsgenie integration.
operationId: DeleteOpsgenieAccount
parameters:
- $ref: "#/components/parameters/OpsgenieAccountIDPathParameter"
responses:
"204":
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
"403":
$ref: "#/components/responses/ForbiddenResponse"
"404":
$ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
summary: Delete an Opsgenie account
tags:
- Opsgenie Integration
"x-permission":
operator: OR
permissions:
- manage_integrations
patch:
description: Update a single Opsgenie account in the Datadog Opsgenie integration.
operationId: UpdateOpsgenieAccount
parameters:
- $ref: "#/components/parameters/OpsgenieAccountIDPathParameter"
requestBody:
content:
application/json:
examples:
default:
value:
data:
attributes:
api_key: 00000000-0000-0000-0000-000000000000
region: us
id: 596da4af-0563-4097-90ff-07230c3f9db3
type: opsgenie-account
schema:
$ref: "#/components/schemas/OpsgenieAccountUpdateRequest"
description: Opsgenie account payload.
required: true
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
region: us
id: 00000000-0000-0000-0000-000000000003
type: opsgenie-account
schema:
$ref: "#/components/schemas/OpsgenieAccountResponse"
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
"403":
$ref: "#/components/responses/ForbiddenResponse"
"404":
$ref: "#/components/responses/NotFoundResponse"
"422":
$ref: "#/components/responses/UnprocessableEntityResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
summary: Update an Opsgenie account
tags:
- Opsgenie Integration
x-codegen-request-body-name: body
"x-permission":
operator: OR
permissions:
- manage_integrations
/api/v2/integration/opsgenie/services:
get:
description: Get a list of all services from the Datadog Opsgenie integration.
Expand Down
15 changes: 15 additions & 0 deletions examples/v2/opsgenie-integration/CreateOpsgenieAccount.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Create a new Opsgenie account returns "CREATED" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::OpsgenieIntegrationAPI.new

body = DatadogAPIClient::V2::OpsgenieAccountCreateRequest.new({
data: DatadogAPIClient::V2::OpsgenieAccountCreateData.new({
attributes: DatadogAPIClient::V2::OpsgenieAccountCreateAttributes.new({
api_key: "00000000-0000-0000-0000-000000000000",
region: DatadogAPIClient::V2::OpsgenieServiceRegionType::US,
}),
type: DatadogAPIClient::V2::OpsgenieAccountType::OPSGENIE_ACCOUNT,
}),
})
p api_instance.create_opsgenie_account(body)
5 changes: 5 additions & 0 deletions examples/v2/opsgenie-integration/DeleteOpsgenieAccount.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Delete an Opsgenie account returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::OpsgenieIntegrationAPI.new
api_instance.delete_opsgenie_account("account_id")
5 changes: 5 additions & 0 deletions examples/v2/opsgenie-integration/ListOpsgenieAccounts.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Get all Opsgenie accounts returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::OpsgenieIntegrationAPI.new
p api_instance.list_opsgenie_accounts()
16 changes: 16 additions & 0 deletions examples/v2/opsgenie-integration/UpdateOpsgenieAccount.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Update an Opsgenie account returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::OpsgenieIntegrationAPI.new

body = DatadogAPIClient::V2::OpsgenieAccountUpdateRequest.new({
data: DatadogAPIClient::V2::OpsgenieAccountUpdateData.new({
attributes: DatadogAPIClient::V2::OpsgenieAccountUpdateAttributes.new({
api_key: "00000000-0000-0000-0000-000000000000",
region: DatadogAPIClient::V2::OpsgenieServiceRegionType::US,
}),
id: "596da4af-0563-4097-90ff-07230c3f9db3",
type: DatadogAPIClient::V2::OpsgenieAccountType::OPSGENIE_ACCOUNT,
}),
})
p api_instance.update_opsgenie_account("account_id", body)
10 changes: 10 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3435,6 +3435,16 @@
"tenancy_ocid" => "String",
"body" => "UpdateTenancyConfigRequest",
},
"v2.CreateOpsgenieAccount" => {
"body" => "OpsgenieAccountCreateRequest",
},
"v2.DeleteOpsgenieAccount" => {
"account_id" => "String",
},
"v2.UpdateOpsgenieAccount" => {
"account_id" => "String",
"body" => "OpsgenieAccountUpdateRequest",
},
"v2.CreateOpsgenieService" => {
"body" => "OpsgenieServiceCreateRequest",
},
Expand Down
12 changes: 12 additions & 0 deletions features/v2/given.json
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,18 @@
"tag": "Microsoft Teams Integration",
"operationId": "CreateWorkflowsWebhookHandle"
},
{
"parameters": [
{
"name": "body",
"value": "{\n \"data\": {\n \"attributes\": {\n \"api_key\": \"00000000-0000-0000-0000-000000000000\",\n \"region\": \"us\"\n },\n \"type\": \"opsgenie-account\"\n }\n}"
}
],
"step": "there is a valid \"opsgenie_account\" in the system",
"key": "opsgenie_account",
"tag": "Opsgenie Integration",
"operationId": "CreateOpsgenieAccount"
},
{
"parameters": [
{
Expand Down
Loading
Loading