Skip to content

Latest commit

 

History

History
290 lines (187 loc) · 7.64 KB

GCPIntegrationApi.md

File metadata and controls

290 lines (187 loc) · 7.64 KB

GCPIntegrationApi

All URIs are relative to https://api.datadoghq.com

Method HTTP request Description
CreateGCPIntegration Post /api/v1/integration/gcp Create a GCP integration
DeleteGCPIntegration Delete /api/v1/integration/gcp Delete a GCP integration
ListGCPIntegration Get /api/v1/integration/gcp List all GCP integrations
UpdateGCPIntegration Put /api/v1/integration/gcp Update a GCP integration

CreateGCPIntegration

map[string]interface{} CreateGCPIntegration(ctx, body)

Create a Datadog-GCP integration.

Example

package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog ""
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    body := *datadog.NewGCPAccount() // GCPAccount | Create a Datadog-GCP integration.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.GCPIntegrationApi.CreateGCPIntegration(ctx, body)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `GCPIntegrationApi.CreateGCPIntegration`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateGCPIntegration`: map[string]interface{}
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from GCPIntegrationApi.CreateGCPIntegration:\n%s\n", responseContent)
}

Required Parameters

Name Type Description Notes
ctx context.Context Context for authentication, logging, cancellation, deadlines, tracing, etc.
body GCPAccount Create a Datadog-GCP integration.

Optional Parameters

This endpoint does not have optional parameters.

Return type

map[string]interface{}

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteGCPIntegration

map[string]interface{} DeleteGCPIntegration(ctx, body)

Delete a given Datadog-GCP integration.

Example

package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog ""
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    body := *datadog.NewGCPAccount() // GCPAccount | Delete a given Datadog-GCP integration.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.GCPIntegrationApi.DeleteGCPIntegration(ctx, body)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `GCPIntegrationApi.DeleteGCPIntegration`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `DeleteGCPIntegration`: map[string]interface{}
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from GCPIntegrationApi.DeleteGCPIntegration:\n%s\n", responseContent)
}

Required Parameters

Name Type Description Notes
ctx context.Context Context for authentication, logging, cancellation, deadlines, tracing, etc.
body GCPAccount Delete a given Datadog-GCP integration.

Optional Parameters

This endpoint does not have optional parameters.

Return type

map[string]interface{}

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListGCPIntegration

[]GCPAccount ListGCPIntegration(ctx)

List all Datadog-GCP integrations configured in your Datadog account.

Example

package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog ""
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())


    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.GCPIntegrationApi.ListGCPIntegration(ctx)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `GCPIntegrationApi.ListGCPIntegration`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListGCPIntegration`: []GCPAccount
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from GCPIntegrationApi.ListGCPIntegration:\n%s\n", responseContent)
}

Required Parameters

This endpoint does not need any parameter.

Optional Parameters

This endpoint does not have optional parameters.

Return type

[]GCPAccount

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateGCPIntegration

map[string]interface{} UpdateGCPIntegration(ctx, body)

Update a Datadog-GCP integrations host_filters and/or auto-mute. Requires a project_id and client_email, however these fields cannot be updated. If you need to update these fields, delete and use the create (POST) endpoint. The unspecified fields will keep their original values.

Example

package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog ""
)

func main() {
    ctx := datadog.NewDefaultContext(context.Background())

    body := *datadog.NewGCPAccount() // GCPAccount | Update a Datadog-GCP integration.

    configuration := datadog.NewConfiguration()

    apiClient := datadog.NewAPIClient(configuration)
    resp, r, err := apiClient.GCPIntegrationApi.UpdateGCPIntegration(ctx, body)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `GCPIntegrationApi.UpdateGCPIntegration`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateGCPIntegration`: map[string]interface{}
    responseContent, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from GCPIntegrationApi.UpdateGCPIntegration:\n%s\n", responseContent)
}

Required Parameters

Name Type Description Notes
ctx context.Context Context for authentication, logging, cancellation, deadlines, tracing, etc.
body GCPAccount Update a Datadog-GCP integration.

Optional Parameters

This endpoint does not have optional parameters.

Return type

map[string]interface{}

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]