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
270 changes: 270 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14293,6 +14293,151 @@ components:
test_level:
$ref: "#/components/schemas/CIAppTestLevel"
type: object
CIAppGitHubAccountAttributes:
description: Attributes describing a GitHub account's CI Visibility opt-in status.
properties:
account:
description: The GitHub account (organization or user) name.
example: datadog
type: string
enabled:
description: Whether CI Visibility is enabled at the account level.
example: true
type: boolean
host:
description: The GitHub host (`github.com` or a GHES hostname) this account belongs to.
example: github.com
type: string
repo_count:
description: The number of repositories known for this account.
example: 12
format: int64
type: integer
repositories:
description: The repositories belonging to this account, with their individual opt-in status.
items:
$ref: "#/components/schemas/CIAppGitHubAccountRepository"
type: array
type: object
CIAppGitHubAccountData:
description: Data object for a GitHub account.
properties:
attributes:
$ref: "#/components/schemas/CIAppGitHubAccountAttributes"
id:
description: |-
The account's unique identifier, in the form `<host>/<account name>`
(for example `github.com/datadog`).
example: github.com/datadog
type: string
type:
$ref: "#/components/schemas/CIAppGitHubAccountType"
required:
- id
- type
- attributes
type: object
CIAppGitHubAccountRepository:
description: A GitHub repository within a GitHub account, and its CI Visibility opt-in status.
properties:
enabled:
description: Whether CI Visibility is enabled for this repository.
example: true
type: boolean
name:
description: The repository name.
example: shopist
type: string
type: object
CIAppGitHubAccountResponse:
description: Response object containing a single GitHub account's CI Visibility opt-in status.
properties:
data:
$ref: "#/components/schemas/CIAppGitHubAccountData"
required:
- data
type: object
CIAppGitHubAccountType:
description: |-
JSON:API type for the GitHub account resource.
The value must always be `ci_github_account`.
enum:
- ci_github_account
example: ci_github_account
type: string
x-enum-varnames:
- CI_GITHUB_ACCOUNT
CIAppGitHubAccountUpdateRequest:
description: Request object for updating a GitHub account's CI Visibility opt-in status.
properties:
data:
$ref: "#/components/schemas/CIAppGitHubAccountUpdateRequestData"
required:
- data
type: object
CIAppGitHubAccountUpdateRequestAttributes:
description: |-
Attributes for updating a GitHub account's CI Visibility opt-in status.
At least one of `enabled` or `repository.enabled` must be provided.
Account-level and repository-level opt-in changes are independent and may both be supplied in the same request.
properties:
account:
description: The GitHub account (organization or user) name to update, identified by name.
example: datadog
minLength: 1
type: string
enabled:
description: Whether to enable or disable CI Visibility at the account level.
example: true
type: boolean
host:
description: |-
The GitHub host (`github.com` or a GHES hostname) the account belongs to. Required to disambiguate
when the same account name exists on more than one host.
example: github.com
type: string
repository:
$ref: "#/components/schemas/CIAppGitHubAccountUpdateRequestRepository"
required:
- account
type: object
CIAppGitHubAccountUpdateRequestData:
description: Data object for updating a GitHub account's CI Visibility opt-in status.
properties:
attributes:
$ref: "#/components/schemas/CIAppGitHubAccountUpdateRequestAttributes"
type:
$ref: "#/components/schemas/CIAppGitHubAccountType"
required:
- type
- attributes
type: object
CIAppGitHubAccountUpdateRequestRepository:
description: Repository-level opt-in change to apply, identified by name.
properties:
enabled:
description: Whether to enable or disable CI Visibility for this repository.
example: true
type: boolean
name:
description: The repository name to update.
example: shopist
minLength: 1
type: string
required:
- name
- enabled
type: object
CIAppGitHubAccountsResponse:
description: Response object containing a list of GitHub accounts and their CI Visibility opt-in status.
properties:
data:
items:
$ref: "#/components/schemas/CIAppGitHubAccountData"
type: array
required:
- data
type: object
CIAppGitInfo:
description: |-
If pipelines are triggered due to actions to a Git repository, then all payloads must contain this.
Expand Down Expand Up @@ -130420,6 +130565,127 @@ 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/ci/github/accounts:
get:
description: |-
Retrieve the list of GitHub accounts (organizations or users) available to this Datadog organization
through its GitHub App installation, along with each account's and repository's CI Visibility opt-in status.
operationId: ListCIAppGitHubAccounts
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
- attributes:
account: datadog
enabled: true
host: github.com
repo_count: 2
repositories:
- enabled: true
name: shopist
- enabled: false
name: dd-source
id: github.com/datadog
type: ci_github_account
schema:
$ref: "#/components/schemas/CIAppGitHubAccountsResponse"
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
"403":
$ref: "#/components/responses/NotAuthorizedResponse"
"404":
$ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- integrations_read
summary: List GitHub CI Visibility status
tags: ["CI Visibility GitHub Accounts"]
x-permission:
operator: OR
permissions:
- integrations_read
patch:
description: |-
Enable or disable CI Visibility for a GitHub account, one of its repositories, or both in the same request.
The account (and, optionally, repository) are identified by name. Account-level and repository-level
changes are independent and may both be supplied in the same request. At least one of `enabled` or
`repository.enabled` must be provided. If the account name matches installations on more than one host,
`host` must be supplied to disambiguate, otherwise a 409 is returned. Returns a 404 if the CI Visibility
GitHub integration is not enabled for this organization, or if the given account or repository cannot be
found by name.
operationId: UpdateCIAppGitHubAccount
requestBody:
content:
application/json:
examples:
default:
value:
data:
attributes:
account: datadog
enabled: true
host: github.com
repository:
enabled: true
name: shopist
type: ci_github_account
schema:
$ref: "#/components/schemas/CIAppGitHubAccountUpdateRequest"
required: true
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
account: datadog
enabled: true
host: github.com
repo_count: 2
repositories:
- enabled: true
name: shopist
- enabled: false
name: dd-source
id: github.com/datadog
type: ci_github_account
schema:
$ref: "#/components/schemas/CIAppGitHubAccountResponse"
description: OK
"400":
$ref: "#/components/responses/BadRequestResponse"
"403":
$ref: "#/components/responses/NotAuthorizedResponse"
"404":
$ref: "#/components/responses/NotFoundResponse"
"409":
$ref: "#/components/responses/ConflictResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- ci_provider_settings_write
summary: Update GitHub CI Visibility status
tags: ["CI Visibility GitHub Accounts"]
x-codegen-request-body-name: body
x-permission:
operator: OR
permissions:
- ci_provider_settings_write
/api/v2/ci/pipeline:
post:
description: |-
Expand Down Expand Up @@ -213105,6 +213371,10 @@ tags:
- description: |-
Use the Bits AI endpoints to retrieve AI-powered investigations.
name: Bits AI
- description: |-
Manage CI Visibility opt-in status for your GitHub accounts and repositories. See the
[CI Visibility GitHub Actions setup page](https://docs.datadoghq.com/continuous_integration/setup_dd_ci_visibility_pipelines/github_actions/) for more information.
name: CI Visibility GitHub Accounts
- description: |-
Search or aggregate your CI Visibility pipeline events and send them to your Datadog site over HTTP. See the [CI Pipeline Visibility in Datadog page](https://docs.datadoghq.com/continuous_integration/pipelines/) for more information.
name: CI Visibility Pipelines
Expand Down
7 changes: 7 additions & 0 deletions docs/datadog_api_client.v2.api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ datadog\_api\_client.v2.api.change\_management\_api module
:members:
:show-inheritance:

datadog\_api\_client.v2.api.ci\_visibility\_git\_hub\_accounts\_api module
--------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.api.ci_visibility_git_hub_accounts_api
:members:
:show-inheritance:

datadog\_api\_client.v2.api.ci\_visibility\_pipelines\_api module
-----------------------------------------------------------------

Expand Down
70 changes: 70 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6304,6 +6304,76 @@ datadog\_api\_client.v2.model.ci\_app\_event\_attributes module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.ci\_app\_git\_hub\_account\_attributes module
---------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.ci_app_git_hub_account_attributes
:members:
:show-inheritance:

datadog\_api\_client.v2.model.ci\_app\_git\_hub\_account\_data module
---------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.ci_app_git_hub_account_data
:members:
:show-inheritance:

datadog\_api\_client.v2.model.ci\_app\_git\_hub\_account\_repository module
---------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.ci_app_git_hub_account_repository
:members:
:show-inheritance:

datadog\_api\_client.v2.model.ci\_app\_git\_hub\_account\_response module
-------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.ci_app_git_hub_account_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.ci\_app\_git\_hub\_account\_type module
---------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.ci_app_git_hub_account_type
:members:
:show-inheritance:

datadog\_api\_client.v2.model.ci\_app\_git\_hub\_account\_update\_request module
--------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.ci_app_git_hub_account_update_request
:members:
:show-inheritance:

datadog\_api\_client.v2.model.ci\_app\_git\_hub\_account\_update\_request\_attributes module
--------------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.ci_app_git_hub_account_update_request_attributes
:members:
:show-inheritance:

datadog\_api\_client.v2.model.ci\_app\_git\_hub\_account\_update\_request\_data module
--------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.ci_app_git_hub_account_update_request_data
:members:
:show-inheritance:

datadog\_api\_client.v2.model.ci\_app\_git\_hub\_account\_update\_request\_repository module
--------------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.ci_app_git_hub_account_update_request_repository
:members:
:show-inheritance:

datadog\_api\_client.v2.model.ci\_app\_git\_hub\_accounts\_response module
--------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.ci_app_git_hub_accounts_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.ci\_app\_git\_info module
-------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
List GitHub CI Visibility status returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.ci_visibility_git_hub_accounts_api import CIVisibilityGitHubAccountsApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = CIVisibilityGitHubAccountsApi(api_client)
response = api_instance.list_ci_app_git_hub_accounts()

print(response)
Loading
Loading