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
254 changes: 254 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37347,6 +37347,75 @@ components:
type: string
x-enum-varnames:
- INCIDENTS_GLOBAL_SETTINGS
GlobalOrg:
description: Organization information for a global organization association.
properties:
id:
description: The numeric ID of the organization.
example: 123
format: int64
type: integer
name:
description: The name of the organization.
example: Example Org
type: string
public_id:
description: The public identifier of the organization.
example: abcdef12345
nullable: true
type: string
subdomain:
description: The subdomain used to access the organization, if configured.
example: example
nullable: true
type: string
uuid:
description: The UUID of the organization.
example: "13d10a96-6ff2-49be-be7b-4f56ebb13335"
format: uuid
type: string
required:
- id
- uuid
- name
type: object
GlobalOrgAttributes:
description: Attributes of an organization associated with the authenticated user.
properties:
org:
$ref: "#/components/schemas/GlobalOrg"
redirect_url:
description: The login URL used to switch into the organization, if available.
example: "https://app.datadoghq.com/account/login/password?dd_oid=13d10a96-6ff2-49be-be7b-4f56ebb13335&login_hint=user%40example.com"
nullable: true
type: string
source_region:
description: The source region of the organization.
example: us1.prod.dog
type: string
user:
$ref: "#/components/schemas/GlobalOrgUser"
required:
- user
- org
- source_region
type: object
GlobalOrgData:
description: An organization associated with the authenticated user.
properties:
attributes:
$ref: "#/components/schemas/GlobalOrgAttributes"
id:
description: A unique identifier for this user and organization association.
example: "cfab5cf9-5472-48ea-a79c-a64045f4f745-13d10a96-6ff2-49be-be7b-4f56ebb13335"
type: string
type:
$ref: "#/components/schemas/GlobalOrgType"
required:
- id
- type
- attributes
type: object
GlobalOrgIdentifier:
description: A unique identifier for an organization including its site.
properties:
Expand All @@ -37363,6 +37432,104 @@ components:
- org_uuid
- org_site
type: object
GlobalOrgType:
description: The resource type for global user organizations.
enum: [global_user_orgs]
example: global_user_orgs
type: string
x-enum-varnames:
- GLOBAL_USER_ORGS
GlobalOrgUser:
description: User information for a global organization association.
properties:
handle:
description: The handle of the user.
example: user@example.com
type: string
id:
description: The numeric ID of the user.
example: 42
format: int64
type: integer
uuid:
description: The UUID of the user.
example: "cfab5cf9-5472-48ea-a79c-a64045f4f745"
format: uuid
type: string
required:
- id
- uuid
- handle
type: object
GlobalOrgsLinks:
description: Pagination links.
properties:
next:
description: Link to the next page.
example: "https://app.datadoghq.com/api/v2/global_orgs?user_handle=user@example.com&page[limit]=100&page[cursor]=next-page"
nullable: true
type: string
prev:
description: Link to the previous page.
nullable: true
type: string
self:
description: Link to the current page.
example: "https://app.datadoghq.com/api/v2/global_orgs?user_handle=user@example.com&page[limit]=100"
type: string
type: object
GlobalOrgsMeta:
description: Response metadata object.
properties:
page:
$ref: "#/components/schemas/GlobalOrgsMetaPage"
type: object
GlobalOrgsMetaPage:
description: Paging attributes.
properties:
cursor:
description: The cursor used to get the current results, if any.
example: ""
type: string
limit:
description: Number of results returned.
example: 100
format: int32
type: integer
next_cursor:
description: The cursor used to get the next results, if any.
example: next-page
nullable: true
type: string
prev_cursor:
description: The cursor used to get the previous results, if any.
nullable: true
type: string
type:
$ref: "#/components/schemas/GlobalOrgsMetaPageType"
type: object
GlobalOrgsMetaPageType:
description: Type of global orgs pagination.
enum: [cursor]
example: cursor
type: string
x-enum-varnames:
- CURSOR
GlobalOrgsResponse:
description: Response containing organizations across regions for the authenticated user.
properties:
data:
description: Organizations across regions for the authenticated user.
items:
$ref: "#/components/schemas/GlobalOrgData"
type: array
links:
$ref: "#/components/schemas/GlobalOrgsLinks"
meta:
$ref: "#/components/schemas/GlobalOrgsMeta"
required:
- data
type: object
GlobalVariableData:
description: Synthetics global variable data. Wrapper around the global variable object.
properties:
Expand Down Expand Up @@ -119736,6 +119903,93 @@ paths:
permissions:
- feature_flag_config_write
- feature_flag_environment_config_read
/api/v2/global_orgs:
get:
description: |-
Returns organizations across regions for the authenticated user. The `user_handle` query parameter must match the authenticated user's handle.
operationId: ListGlobalOrgs
parameters:
- description: The handle of the authenticated user.
in: query
name: user_handle
required: true
schema:
example: user@example.com
type: string
- description: Maximum number of results returned.
in: query
name: page[limit]
required: false
schema:
default: 100
format: int32
maximum: 1000
minimum: 1
type: integer
- description: |-
String to query the next page of results.
This key is provided with each valid response from the API in `meta.page.next_cursor`.
in: query
name: page[cursor]
required: false
schema:
type: string
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
- attributes:
org:
id: 123
name: Example Org
public_id: abcdef12345
subdomain: example
uuid: "13d10a96-6ff2-49be-be7b-4f56ebb13335"
redirect_url: "https://app.datadoghq.com/account/login/password?dd_oid=13d10a96-6ff2-49be-be7b-4f56ebb13335&login_hint=user%40example.com"
source_region: us1.prod.dog
user:
handle: user@example.com
id: 42
uuid: "cfab5cf9-5472-48ea-a79c-a64045f4f745"
id: "cfab5cf9-5472-48ea-a79c-a64045f4f745-13d10a96-6ff2-49be-be7b-4f56ebb13335"
type: global_user_orgs
links:
next: "https://app.datadoghq.com/api/v2/global_orgs?user_handle=user@example.com&page[limit]=100&page[cursor]=next-page"
self: "https://app.datadoghq.com/api/v2/global_orgs?user_handle=user@example.com&page[limit]=100"
meta:
page:
cursor: ""
limit: 100
next_cursor: next-page
type: cursor
schema:
$ref: "#/components/schemas/GlobalOrgsResponse"
description: OK
"400": {$ref: "#/components/responses/BadRequestResponse"}
"401": {$ref: "#/components/responses/UnauthorizedResponse"}
"403": {$ref: "#/components/responses/ForbiddenResponse"}
"429": {$ref: "#/components/responses/TooManyRequestsResponse"}
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- user_access_read
summary: List global orgs
tags:
- Organizations
x-pagination:
cursorParam: page[cursor]
cursorPath: meta.page.next_cursor
limitParam: page[limit]
resultsPath: data
"x-permission":
operator: OR
permissions:
- user_access_read
/api/v2/hamr:
get:
description: |-
Expand Down
5 changes: 5 additions & 0 deletions examples/v2/organizations/ListGlobalOrgs.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# List global orgs returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::OrganizationsAPI.new
p api_instance.list_global_orgs("user@example.com")
5 changes: 5 additions & 0 deletions examples/v2/organizations/ListGlobalOrgs_465966063.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# List global orgs returns "OK" response with pagination

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::OrganizationsAPI.new
api_instance.list_global_orgs_with_pagination("user@example.com") { |item| puts item }
31 changes: 18 additions & 13 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3099,6 +3099,24 @@
"v2.UnarchiveFeatureFlag" => {
"feature_flag_id" => "UUID",
},
"v2.ListGlobalOrgs" => {
"user_handle" => "String",
"page_limit" => "Integer",
"page_cursor" => "String",
},
"v2.ListOrgs" => {
"filter_name" => "String",
},
"v2.GetOrgConfig" => {
"org_config_name" => "String",
},
"v2.UpdateOrgConfig" => {
"org_config_name" => "String",
"body" => "OrgConfigWriteRequest",
},
"v2.UploadIdPMetadata" => {
"idp_file" => "File",
},
"v2.CreateHamrOrgConnection" => {
"body" => "HamrOrgConnectionRequest",
},
Expand Down Expand Up @@ -4083,19 +4101,6 @@
"v2.ResolveOnCallPage" => {
"page_id" => "UUID",
},
"v2.ListOrgs" => {
"filter_name" => "String",
},
"v2.GetOrgConfig" => {
"org_config_name" => "String",
},
"v2.UpdateOrgConfig" => {
"org_config_name" => "String",
"body" => "OrgConfigWriteRequest",
},
"v2.UploadIdPMetadata" => {
"idp_file" => "File",
},
"v2.ListOrgConnections" => {
"sink_org_id" => "String",
"source_org_id" => "String",
Expand Down
21 changes: 21 additions & 0 deletions features/v2/organizations.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,27 @@ Feature: Organizations
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/delegated-auth-login
Scenario: List global orgs returns "Bad Request" response
Given new "ListGlobalOrgs" request
And request contains "user_handle" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/delegated-auth-login
Scenario: List global orgs returns "OK" response
Given new "ListGlobalOrgs" request
And request contains "user_handle" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/delegated-auth-login @with-pagination
Scenario: List global orgs returns "OK" response with pagination
Given new "ListGlobalOrgs" request
And request contains "user_handle" parameter from "REPLACE.ME"
When the request with pagination is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/org-management
Scenario: List your managed organizations returns "OK" response
Given new "ListOrgs" request
Expand Down
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2609,6 +2609,12 @@
"type": "unsafe"
}
},
"ListGlobalOrgs": {
"tag": "Organizations",
"undo": {
"type": "safe"
}
},
"GetHamrOrgConnection": {
"tag": "High Availability MultiRegion",
"undo": {
Expand Down
10 changes: 10 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3313,7 +3313,17 @@ def overrides
"v2.global_incident_settings_request" => "GlobalIncidentSettingsRequest",
"v2.global_incident_settings_response" => "GlobalIncidentSettingsResponse",
"v2.global_incident_settings_type" => "GlobalIncidentSettingsType",
"v2.global_org" => "GlobalOrg",
"v2.global_org_attributes" => "GlobalOrgAttributes",
"v2.global_org_data" => "GlobalOrgData",
"v2.global_org_identifier" => "GlobalOrgIdentifier",
"v2.global_orgs_links" => "GlobalOrgsLinks",
"v2.global_orgs_meta" => "GlobalOrgsMeta",
"v2.global_orgs_meta_page" => "GlobalOrgsMetaPage",
"v2.global_orgs_meta_page_type" => "GlobalOrgsMetaPageType",
"v2.global_orgs_response" => "GlobalOrgsResponse",
"v2.global_org_type" => "GlobalOrgType",
"v2.global_org_user" => "GlobalOrgUser",
"v2.global_variable_data" => "GlobalVariableData",
"v2.global_variable_json_patch_request" => "GlobalVariableJsonPatchRequest",
"v2.global_variable_json_patch_request_data" => "GlobalVariableJsonPatchRequestData",
Expand Down
Loading
Loading