Skip to main content

ci_github_accounts

Creates, updates, deletes, gets or lists a ci_github_accounts resource.

Overview

Nameci_github_accounts
TypeResource
Iddatadog.software_delivery.ci_github_accounts

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe account's unique identifier, in the form <host>/<account name> (for example github.com/datadog). (example: github.com/datadog)
attributesobjectAttributes describing a GitHub account's CI Visibility opt-in status.
typestringJSON:API type for the GitHub account resource. The value must always be ci_github_account. (ci_github_account) (example: ci_github_account)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_ciapp_git_hub_accountsselectRetrieve the list of GitHub accounts (organizations or users) available to this Datadog organization<br />through its GitHub App installation, along with each account's and repository's CI Visibility opt-in status.
update_ciapp_git_hub_accountupdatedataEnable or disable CI Visibility for a GitHub account, one of its repositories, or both in the same request.<br />The account (and, optionally, repository) are identified by name. Account-level and repository-level<br />changes are independent and may both be supplied in the same request. At least one of enabled or<br />repository.enabled must be provided. If the account name matches installations on more than one host,<br />host must be supplied to disambiguate, otherwise a 409 is returned. Returns a 404 if the CI Visibility<br />GitHub integration is not enabled for this organization, or if the given account or repository cannot be<br />found by name.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.

SELECT examples

Retrieve the list of GitHub accounts (organizations or users) available to this Datadog organization<br />through its GitHub App installation, along with each account's and repository's CI Visibility opt-in status.

SELECT
id,
attributes,
type
FROM datadog.software_delivery.ci_github_accounts
;

UPDATE examples

Enable or disable CI Visibility for a GitHub account, one of its repositories, or both in the same request.<br />The account (and, optionally, repository) are identified by name. Account-level and repository-level<br />changes are independent and may both be supplied in the same request. At least one of enabled or<br />repository.enabled must be provided. If the account name matches installations on more than one host,<br />host must be supplied to disambiguate, otherwise a 409 is returned. Returns a 404 if the CI Visibility<br />GitHub integration is not enabled for this organization, or if the given account or repository cannot be<br />found by name.

UPDATE datadog.software_delivery.ci_github_accounts
SET
data = '{{ data }}'
WHERE
data = '{{ data }}' --required
RETURNING
data;