Skip to content

Commit 2dbb97e

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add OpenAPI spec for IDP entity integration configs (#1636)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 061d7ad commit 2dbb97e

20 files changed

Lines changed: 1825 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 281 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,14 @@ components:
435435
schema:
436436
example: "service:myservice"
437437
type: string
438+
EntityIntegrationConfigID:
439+
description: The identifier of the integration whose configuration is being managed. Supported values are `github`, `jira`, and `pagerduty`.
440+
in: path
441+
name: integration_id
442+
required: true
443+
schema:
444+
example: github
445+
type: string
438446
FastlyAccountID:
439447
description: Fastly Account id.
440448
in: path
@@ -27185,6 +27193,103 @@ components:
2718527193
description: Entity.
2718627194
type: string
2718727195
type: object
27196+
EntityIntegrationConfigAttributes:
27197+
description: The organization ID, integration identifier, and integration-specific configuration payload for an entity integration configuration.
27198+
properties:
27199+
config:
27200+
$ref: "#/components/schemas/EntityIntegrationConfigPayload"
27201+
integration_id:
27202+
description: The identifier of the integration this configuration applies to (for example, `github`, `jira`, or `pagerduty`).
27203+
example: github
27204+
type: string
27205+
org_id:
27206+
description: The Datadog organization identifier that owns this configuration.
27207+
example: 1234
27208+
format: int64
27209+
type: integer
27210+
required:
27211+
- org_id
27212+
- integration_id
27213+
- config
27214+
type: object
27215+
EntityIntegrationConfigData:
27216+
description: JSON:API resource object for an entity integration configuration.
27217+
properties:
27218+
attributes:
27219+
$ref: "#/components/schemas/EntityIntegrationConfigAttributes"
27220+
id:
27221+
description: Unique identifier of the entity integration configuration.
27222+
example: 01HJABCD12345678ABCDEFGHIJ
27223+
type: string
27224+
type:
27225+
$ref: "#/components/schemas/EntityIntegrationConfigType"
27226+
required:
27227+
- id
27228+
- type
27229+
- attributes
27230+
type: object
27231+
EntityIntegrationConfigPayload:
27232+
additionalProperties: {}
27233+
description: Integration-specific configuration payload. The shape of this object depends on the integration identified by the path parameter. For `github`, the object must contain an `enabled_repos` array. For `jira`, it must contain an `enabled_projects` array. For `pagerduty`, it must contain an `accounts` array.
27234+
example:
27235+
enabled_repos:
27236+
- github_org_name: myorg
27237+
hostname: github.com
27238+
repo_name: myrepo
27239+
type: object
27240+
EntityIntegrationConfigRequest:
27241+
description: Request body used to create or replace the configuration for a given integration.
27242+
properties:
27243+
data:
27244+
$ref: "#/components/schemas/EntityIntegrationConfigRequestData"
27245+
required:
27246+
- data
27247+
type: object
27248+
EntityIntegrationConfigRequestAttributes:
27249+
description: Attributes used to create or update an entity integration configuration.
27250+
properties:
27251+
config:
27252+
$ref: "#/components/schemas/EntityIntegrationConfigPayload"
27253+
required:
27254+
- config
27255+
type: object
27256+
EntityIntegrationConfigRequestData:
27257+
description: JSON:API resource object used in a request to create or update an entity integration configuration.
27258+
properties:
27259+
attributes:
27260+
$ref: "#/components/schemas/EntityIntegrationConfigRequestAttributes"
27261+
type:
27262+
$ref: "#/components/schemas/EntityIntegrationConfigRequestType"
27263+
required:
27264+
- type
27265+
- attributes
27266+
type: object
27267+
EntityIntegrationConfigRequestType:
27268+
default: entity_integration_config_requests
27269+
description: JSON:API resource type for the entity integration configuration create or update request. Always `entity_integration_config_requests`.
27270+
enum:
27271+
- entity_integration_config_requests
27272+
example: entity_integration_config_requests
27273+
type: string
27274+
x-enum-varnames:
27275+
- ENTITY_INTEGRATION_CONFIG_REQUESTS
27276+
EntityIntegrationConfigResponse:
27277+
description: JSON:API document containing a single entity integration configuration resource.
27278+
properties:
27279+
data:
27280+
$ref: "#/components/schemas/EntityIntegrationConfigData"
27281+
required:
27282+
- data
27283+
type: object
27284+
EntityIntegrationConfigType:
27285+
default: entity_integration_configs
27286+
description: JSON:API resource type for an entity integration configuration. Always `entity_integration_configs`.
27287+
enum:
27288+
- entity_integration_configs
27289+
example: entity_integration_configs
27290+
type: string
27291+
x-enum-varnames:
27292+
- ENTITY_INTEGRATION_CONFIGS
2718827293
EntityMeta:
2718927294
description: Entity metadata.
2719027295
properties:
@@ -114861,6 +114966,180 @@ paths:
114861114966
x-unstable: |-
114862114967
**Note**: This endpoint is in public beta and is subject to change.
114863114968
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
114969+
/api/v2/idp/entity_integrations/{integration_id}:
114970+
delete:
114971+
description: Delete the configuration stored for a given integration in the caller's organization.
114972+
operationId: DeleteEntityIntegrationConfig
114973+
parameters:
114974+
- $ref: "#/components/parameters/EntityIntegrationConfigID"
114975+
responses:
114976+
"204":
114977+
description: No Content
114978+
"400":
114979+
content:
114980+
application/json:
114981+
schema:
114982+
$ref: "#/components/schemas/JSONAPIErrorResponse"
114983+
description: Bad Request
114984+
"403":
114985+
$ref: "#/components/responses/NotAuthorizedResponse"
114986+
"404":
114987+
content:
114988+
application/json:
114989+
schema:
114990+
$ref: "#/components/schemas/JSONAPIErrorResponse"
114991+
description: Not Found
114992+
"429":
114993+
$ref: "#/components/responses/TooManyRequestsResponse"
114994+
summary: Delete an entity integration configuration
114995+
tags:
114996+
- Entity Integration Configs
114997+
x-permission:
114998+
operator: OR
114999+
permissions:
115000+
- manage_integrations
115001+
x-unstable: |-
115002+
**Note**: This endpoint is in preview and is subject to change.
115003+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
115004+
get:
115005+
description: Retrieve the configuration currently stored for a given integration in the caller's organization.
115006+
operationId: GetEntityIntegrationConfig
115007+
parameters:
115008+
- $ref: "#/components/parameters/EntityIntegrationConfigID"
115009+
responses:
115010+
"200":
115011+
content:
115012+
application/json:
115013+
example:
115014+
data:
115015+
attributes:
115016+
config:
115017+
enabled_repos:
115018+
- github_org_name: myorg
115019+
hostname: github.com
115020+
repo_name: myrepo
115021+
integration_id: github
115022+
org_id: 1234
115023+
id: 01HJABCD12345678ABCDEFGHIJ
115024+
type: entity_integration_configs
115025+
schema:
115026+
$ref: "#/components/schemas/EntityIntegrationConfigResponse"
115027+
description: OK
115028+
"400":
115029+
content:
115030+
application/json:
115031+
schema:
115032+
$ref: "#/components/schemas/JSONAPIErrorResponse"
115033+
description: Bad Request
115034+
"403":
115035+
$ref: "#/components/responses/NotAuthorizedResponse"
115036+
"404":
115037+
content:
115038+
application/json:
115039+
schema:
115040+
$ref: "#/components/schemas/JSONAPIErrorResponse"
115041+
description: Not Found
115042+
"429":
115043+
$ref: "#/components/responses/TooManyRequestsResponse"
115044+
summary: Get an entity integration configuration
115045+
tags:
115046+
- Entity Integration Configs
115047+
x-permission:
115048+
operator: OR
115049+
permissions:
115050+
- integrations_read
115051+
x-unstable: |-
115052+
**Note**: This endpoint is in preview and is subject to change.
115053+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
115054+
put:
115055+
description: |-
115056+
Create or replace the configuration for a given integration in the caller's organization. The shape of `data.attributes.config` depends on the integration:
115057+
115058+
- For `github`: `config` must contain an `enabled_repos` array of objects with `hostname`, `github_org_name`, and `repo_name`.
115059+
- For `jira`: `config` must contain an `enabled_projects` array of objects with `hostname`, `account_id`, and `project_key`.
115060+
- For `pagerduty`: `config` must contain an `accounts` array of objects with a required `enabled` boolean and an optional `subdomain` string.
115061+
operationId: UpdateEntityIntegrationConfig
115062+
parameters:
115063+
- $ref: "#/components/parameters/EntityIntegrationConfigID"
115064+
requestBody:
115065+
content:
115066+
application/json:
115067+
examples:
115068+
default:
115069+
summary: GitHub integration configuration
115070+
value:
115071+
data:
115072+
attributes:
115073+
config:
115074+
enabled_repos:
115075+
- github_org_name: myorg
115076+
hostname: github.com
115077+
repo_name: myrepo
115078+
type: entity_integration_config_requests
115079+
jira:
115080+
summary: Jira integration configuration
115081+
value:
115082+
data:
115083+
attributes:
115084+
config:
115085+
enabled_projects:
115086+
- account_id: "123456789"
115087+
hostname: mycompany.atlassian.net
115088+
project_key: AAA
115089+
type: entity_integration_config_requests
115090+
pagerduty:
115091+
summary: PagerDuty integration configuration
115092+
value:
115093+
data:
115094+
attributes:
115095+
config:
115096+
accounts:
115097+
- enabled: true
115098+
subdomain: mycompany
115099+
type: entity_integration_config_requests
115100+
schema:
115101+
$ref: "#/components/schemas/EntityIntegrationConfigRequest"
115102+
required: true
115103+
responses:
115104+
"200":
115105+
content:
115106+
application/json:
115107+
example:
115108+
data:
115109+
attributes:
115110+
config:
115111+
enabled_repos:
115112+
- github_org_name: myorg
115113+
hostname: github.com
115114+
repo_name: myrepo
115115+
integration_id: github
115116+
org_id: 1234
115117+
id: 01HJABCD12345678ABCDEFGHIJ
115118+
type: entity_integration_configs
115119+
schema:
115120+
$ref: "#/components/schemas/EntityIntegrationConfigResponse"
115121+
description: OK
115122+
"400":
115123+
content:
115124+
application/json:
115125+
schema:
115126+
$ref: "#/components/schemas/JSONAPIErrorResponse"
115127+
description: Bad Request
115128+
"403":
115129+
$ref: "#/components/responses/NotAuthorizedResponse"
115130+
"429":
115131+
$ref: "#/components/responses/TooManyRequestsResponse"
115132+
summary: Create or update entity integration configuration
115133+
tags:
115134+
- Entity Integration Configs
115135+
x-codegen-request-body-name: body
115136+
x-permission:
115137+
operator: OR
115138+
permissions:
115139+
- integrations_read
115140+
x-unstable: |-
115141+
**Note**: This endpoint is in preview and is subject to change.
115142+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
114864115143
/api/v2/incidents:
114865115144
get:
114866115145
description: >-
@@ -162239,6 +162518,8 @@ tags:
162239162518
scopes from alerting. Downtime settings, which can be scheduled with start and
162240162519
end times, prevent all alerting related to specified Datadog tags.
162241162520
name: Downtimes
162521+
- description: Manage per-integration configurations for the Internal Developer Portal (IDP). These configurations control which external resources (for example, GitHub repositories, Jira projects, or PagerDuty services) are synced as entities into the Software Catalog.
162522+
name: Entity Integration Configs
162242162523
- description: Retrieves security risk scores for entities in your organization.
162243162524
name: Entity Risk Scores
162244162525
- description: View and manage issues within Error Tracking. See the [Error Tracking page](https://docs.datadoghq.com/error_tracking/) for more information.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Delete an entity integration configuration returns "No Content" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_entity_integration_configs::EntityIntegrationConfigsAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let mut configuration = datadog::Configuration::new();
8+
configuration.set_unstable_operation_enabled("v2.DeleteEntityIntegrationConfig", true);
9+
let api = EntityIntegrationConfigsAPI::with_config(configuration);
10+
let resp = api
11+
.delete_entity_integration_config("github".to_string())
12+
.await;
13+
if let Ok(value) = resp {
14+
println!("{:#?}", value);
15+
} else {
16+
println!("{:#?}", resp.unwrap_err());
17+
}
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Get an entity integration configuration returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_entity_integration_configs::EntityIntegrationConfigsAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let mut configuration = datadog::Configuration::new();
8+
configuration.set_unstable_operation_enabled("v2.GetEntityIntegrationConfig", true);
9+
let api = EntityIntegrationConfigsAPI::with_config(configuration);
10+
let resp = api
11+
.get_entity_integration_config("github".to_string())
12+
.await;
13+
if let Ok(value) = resp {
14+
println!("{:#?}", value);
15+
} else {
16+
println!("{:#?}", resp.unwrap_err());
17+
}
18+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Create or update entity integration configuration returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_entity_integration_configs::EntityIntegrationConfigsAPI;
4+
use datadog_api_client::datadogV2::model::EntityIntegrationConfigRequest;
5+
use datadog_api_client::datadogV2::model::EntityIntegrationConfigRequestAttributes;
6+
use datadog_api_client::datadogV2::model::EntityIntegrationConfigRequestData;
7+
use datadog_api_client::datadogV2::model::EntityIntegrationConfigRequestType;
8+
use std::collections::BTreeMap;
9+
10+
#[tokio::main]
11+
async fn main() {
12+
let body = EntityIntegrationConfigRequest::new(EntityIntegrationConfigRequestData::new(
13+
EntityIntegrationConfigRequestAttributes::new(BTreeMap::from([])),
14+
EntityIntegrationConfigRequestType::ENTITY_INTEGRATION_CONFIG_REQUESTS,
15+
));
16+
let mut configuration = datadog::Configuration::new();
17+
configuration.set_unstable_operation_enabled("v2.UpdateEntityIntegrationConfig", true);
18+
let api = EntityIntegrationConfigsAPI::with_config(configuration);
19+
let resp = api
20+
.update_entity_integration_config("github".to_string(), body)
21+
.await;
22+
if let Ok(value) = resp {
23+
println!("{:#?}", value);
24+
} else {
25+
println!("{:#?}", resp.unwrap_err());
26+
}
27+
}

src/datadog/configuration.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,9 @@ impl Default for Configuration {
403403
("v2.update_deployment_rule".to_owned(), false),
404404
("v2.create_hamr_org_connection".to_owned(), false),
405405
("v2.get_hamr_org_connection".to_owned(), false),
406+
("v2.delete_entity_integration_config".to_owned(), false),
407+
("v2.get_entity_integration_config".to_owned(), false),
408+
("v2.update_entity_integration_config".to_owned(), false),
406409
("v2.create_global_incident_handle".to_owned(), false),
407410
("v2.create_incident".to_owned(), false),
408411
("v2.create_incident_attachment".to_owned(), false),

0 commit comments

Comments
 (0)