"""
Get Okta account returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.okta_integration_apiimportOktaIntegrationApi# there is a valid "okta_account" in the systemOKTA_ACCOUNT_DATA_ID=environ["OKTA_ACCOUNT_DATA_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=OktaIntegrationApi(api_client)response=api_instance.get_okta_account(account_id=OKTA_ACCOUNT_DATA_ID,)print(response)
# Get Okta account returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::OktaIntegrationAPI.new# there is a valid "okta_account" in the systemOKTA_ACCOUNT_DATA_ID=ENV["OKTA_ACCOUNT_DATA_ID"]papi_instance.get_okta_account(OKTA_ACCOUNT_DATA_ID)
// Get Okta account returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "okta_account" in the system
OktaAccountDataID:=os.Getenv("OKTA_ACCOUNT_DATA_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewOktaIntegrationApi(apiClient)resp,r,err:=api.GetOktaAccount(ctx,OktaAccountDataID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `OktaIntegrationApi.GetOktaAccount`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `OktaIntegrationApi.GetOktaAccount`:\n%s\n",responseContent)}
// Get Okta account returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.OktaIntegrationApi;importcom.datadog.api.client.v2.model.OktaAccountResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();OktaIntegrationApiapiInstance=newOktaIntegrationApi(defaultClient);// there is a valid "okta_account" in the systemStringOKTA_ACCOUNT_DATA_ID=System.getenv("OKTA_ACCOUNT_DATA_ID");try{OktaAccountResponseresult=apiInstance.getOktaAccount(OKTA_ACCOUNT_DATA_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling OktaIntegrationApi#getOktaAccount");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
/**
* Get Okta account returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.OktaIntegrationApi(configuration);// there is a valid "okta_account" in the system
constOKTA_ACCOUNT_DATA_ID=process.env.OKTA_ACCOUNT_DATA_IDasstring;constparams: v2.OktaIntegrationApiGetOktaAccountRequest={accountId: OKTA_ACCOUNT_DATA_ID,};apiInstance.getOktaAccount(params).then((data: v2.OktaAccountResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
// Update Okta account returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){// there is a valid "okta_account" in the system
OktaAccountDataID:=os.Getenv("OKTA_ACCOUNT_DATA_ID")body:=datadogV2.OktaAccountUpdateRequest{Data:datadogV2.OktaAccountUpdateRequestData{Attributes:&datadogV2.OktaAccountUpdateRequestAttributes{AuthMethod:"oauth",Domain:"https://example.okta.com/",ClientId:datadog.PtrString("client_id"),ClientSecret:datadog.PtrString("client_secret"),},Type:datadogV2.OKTAACCOUNTTYPE_OKTA_ACCOUNTS.Ptr(),},}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewOktaIntegrationApi(apiClient)resp,r,err:=api.UpdateOktaAccount(ctx,OktaAccountDataID,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `OktaIntegrationApi.UpdateOktaAccount`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `OktaIntegrationApi.UpdateOktaAccount`:\n%s\n",responseContent)}
// Update Okta account returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.OktaIntegrationApi;importcom.datadog.api.client.v2.model.OktaAccountResponse;importcom.datadog.api.client.v2.model.OktaAccountType;importcom.datadog.api.client.v2.model.OktaAccountUpdateRequest;importcom.datadog.api.client.v2.model.OktaAccountUpdateRequestAttributes;importcom.datadog.api.client.v2.model.OktaAccountUpdateRequestData;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();OktaIntegrationApiapiInstance=newOktaIntegrationApi(defaultClient);// there is a valid "okta_account" in the systemStringOKTA_ACCOUNT_DATA_ID=System.getenv("OKTA_ACCOUNT_DATA_ID");OktaAccountUpdateRequestbody=newOktaAccountUpdateRequest().data(newOktaAccountUpdateRequestData().attributes(newOktaAccountUpdateRequestAttributes().authMethod("oauth").domain("https://example.okta.com/").clientId("client_id").clientSecret("client_secret")).type(OktaAccountType.OKTA_ACCOUNTS));try{OktaAccountResponseresult=apiInstance.updateOktaAccount(OKTA_ACCOUNT_DATA_ID,body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling OktaIntegrationApi#updateOktaAccount");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Update Okta account returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.okta_integration_apiimportOktaIntegrationApifromdatadog_api_client.v2.model.okta_account_typeimportOktaAccountTypefromdatadog_api_client.v2.model.okta_account_update_requestimportOktaAccountUpdateRequestfromdatadog_api_client.v2.model.okta_account_update_request_attributesimportOktaAccountUpdateRequestAttributesfromdatadog_api_client.v2.model.okta_account_update_request_dataimportOktaAccountUpdateRequestData# there is a valid "okta_account" in the systemOKTA_ACCOUNT_DATA_ID=environ["OKTA_ACCOUNT_DATA_ID"]body=OktaAccountUpdateRequest(data=OktaAccountUpdateRequestData(attributes=OktaAccountUpdateRequestAttributes(auth_method="oauth",domain="https://example.okta.com/",client_id="client_id",client_secret="client_secret",),type=OktaAccountType.OKTA_ACCOUNTS,),)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=OktaIntegrationApi(api_client)response=api_instance.update_okta_account(account_id=OKTA_ACCOUNT_DATA_ID,body=body)print(response)
# Update Okta account returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V2::OktaIntegrationAPI.new# there is a valid "okta_account" in the systemOKTA_ACCOUNT_DATA_ID=ENV["OKTA_ACCOUNT_DATA_ID"]body=DatadogAPIClient::V2::OktaAccountUpdateRequest.new({data:DatadogAPIClient::V2::OktaAccountUpdateRequestData.new({attributes:DatadogAPIClient::V2::OktaAccountUpdateRequestAttributes.new({auth_method:"oauth",domain:"https://example.okta.com/",client_id:"client_id",client_secret:"client_secret",}),type:DatadogAPIClient::V2::OktaAccountType::OKTA_ACCOUNTS,}),})papi_instance.update_okta_account(OKTA_ACCOUNT_DATA_ID,body)
/**
* Update Okta account returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv2.OktaIntegrationApi(configuration);// there is a valid "okta_account" in the system
constOKTA_ACCOUNT_DATA_ID=process.env.OKTA_ACCOUNT_DATA_IDasstring;constparams: v2.OktaIntegrationApiUpdateOktaAccountRequest={body:{data:{attributes:{authMethod:"oauth",domain:"https://example.okta.com/",clientId:"client_id",clientSecret:"client_secret",},type:"okta-accounts",},},accountId: OKTA_ACCOUNT_DATA_ID,};apiInstance.updateOktaAccount(params).then((data: v2.OktaAccountResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));