All URIs are relative to https://api.datadoghq.com
Method | HTTP request | Description |
---|---|---|
AddReadRoleToArchive | Post /api/v2/logs/config/archives/{archive_id}/readers | Grant role to an archive |
CreateLogsArchive | Post /api/v2/logs/config/archives | Create an archive |
DeleteLogsArchive | Delete /api/v2/logs/config/archives/{archive_id} | Delete an archive |
GetLogsArchive | Get /api/v2/logs/config/archives/{archive_id} | Get an archive |
GetLogsArchiveOrder | Get /api/v2/logs/config/archive-order | Get archive order |
ListArchiveReadRoles | Get /api/v2/logs/config/archives/{archive_id}/readers | List read roles for an archive |
ListLogsArchives | Get /api/v2/logs/config/archives | Get all archives |
RemoveRoleFromArchive | Delete /api/v2/logs/config/archives/{archive_id}/readers | Revoke role from an archive |
UpdateLogsArchive | Put /api/v2/logs/config/archives/{archive_id} | Update an archive |
UpdateLogsArchiveOrder | Put /api/v2/logs/config/archive-order | Update archive order |
AddReadRoleToArchive(ctx, archiveId, body)
Adds a read role to an archive. (Roles API)
package main
import (
"context"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v2/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
archiveId := "archiveId_example" // string | The ID of the archive.
body := *datadog.NewRelationshipToRole() // RelationshipToRole |
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
r, err := apiClient.LogsArchivesApi.AddReadRoleToArchive(ctx, archiveId, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LogsArchivesApi.AddReadRoleToArchive`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | Context for authentication, logging, cancellation, deadlines, tracing, etc. | |
archiveId | string | The ID of the archive. | |
body | RelationshipToRole |
This endpoint does not have optional parameters.
(empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
LogsArchive CreateLogsArchive(ctx, body)
Create an archive in your organization.
package main
import (
"context"
"encoding/json"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v2/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
body := *datadog.NewLogsArchiveCreateRequest() // LogsArchiveCreateRequest | The definition of the new archive.
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.LogsArchivesApi.CreateLogsArchive(ctx, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LogsArchivesApi.CreateLogsArchive`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateLogsArchive`: LogsArchive
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from LogsArchivesApi.CreateLogsArchive:\n%s\n", responseContent)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | Context for authentication, logging, cancellation, deadlines, tracing, etc. | |
body | LogsArchiveCreateRequest | The definition of the new archive. |
This endpoint does not have optional parameters.
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteLogsArchive(ctx, archiveId)
Delete a given archive from your organization.
package main
import (
"context"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v2/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
archiveId := "archiveId_example" // string | The ID of the archive.
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
r, err := apiClient.LogsArchivesApi.DeleteLogsArchive(ctx, archiveId)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LogsArchivesApi.DeleteLogsArchive`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | Context for authentication, logging, cancellation, deadlines, tracing, etc. | |
archiveId | string | The ID of the archive. |
This endpoint does not have optional parameters.
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
LogsArchive GetLogsArchive(ctx, archiveId)
Get a specific archive from your organization.
package main
import (
"context"
"encoding/json"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v2/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
archiveId := "archiveId_example" // string | The ID of the archive.
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.LogsArchivesApi.GetLogsArchive(ctx, archiveId)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LogsArchivesApi.GetLogsArchive`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetLogsArchive`: LogsArchive
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from LogsArchivesApi.GetLogsArchive:\n%s\n", responseContent)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | Context for authentication, logging, cancellation, deadlines, tracing, etc. | |
archiveId | string | The ID of the archive. |
This endpoint does not have optional parameters.
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
LogsArchiveOrder GetLogsArchiveOrder(ctx)
Get the current order of your archives. This endpoint takes no JSON arguments.
package main
import (
"context"
"encoding/json"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v2/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.LogsArchivesApi.GetLogsArchiveOrder(ctx)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LogsArchivesApi.GetLogsArchiveOrder`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetLogsArchiveOrder`: LogsArchiveOrder
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from LogsArchivesApi.GetLogsArchiveOrder:\n%s\n", responseContent)
}
This endpoint does not need any parameter.
This endpoint does not have optional parameters.
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RolesResponse ListArchiveReadRoles(ctx, archiveId)
Returns all read roles a given archive is restricted to.
package main
import (
"context"
"encoding/json"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v2/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
archiveId := "archiveId_example" // string | The ID of the archive.
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.LogsArchivesApi.ListArchiveReadRoles(ctx, archiveId)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LogsArchivesApi.ListArchiveReadRoles`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListArchiveReadRoles`: RolesResponse
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from LogsArchivesApi.ListArchiveReadRoles:\n%s\n", responseContent)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | Context for authentication, logging, cancellation, deadlines, tracing, etc. | |
archiveId | string | The ID of the archive. |
This endpoint does not have optional parameters.
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
LogsArchives ListLogsArchives(ctx)
Get the list of configured logs archives with their definitions.
package main
import (
"context"
"encoding/json"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v2/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.LogsArchivesApi.ListLogsArchives(ctx)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LogsArchivesApi.ListLogsArchives`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListLogsArchives`: LogsArchives
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from LogsArchivesApi.ListLogsArchives:\n%s\n", responseContent)
}
This endpoint does not need any parameter.
This endpoint does not have optional parameters.
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RemoveRoleFromArchive(ctx, archiveId, body)
Removes a role from an archive. (Roles API)
package main
import (
"context"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v2/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
archiveId := "archiveId_example" // string | The ID of the archive.
body := *datadog.NewRelationshipToRole() // RelationshipToRole |
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
r, err := apiClient.LogsArchivesApi.RemoveRoleFromArchive(ctx, archiveId, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LogsArchivesApi.RemoveRoleFromArchive`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | Context for authentication, logging, cancellation, deadlines, tracing, etc. | |
archiveId | string | The ID of the archive. | |
body | RelationshipToRole |
This endpoint does not have optional parameters.
(empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
LogsArchive UpdateLogsArchive(ctx, archiveId, body)
Update a given archive configuration.
Note: Using this method updates your archive configuration by replacing your current configuration with the new one sent to your Datadog organization.
package main
import (
"context"
"encoding/json"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v2/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
archiveId := "archiveId_example" // string | The ID of the archive.
body := *datadog.NewLogsArchiveCreateRequest() // LogsArchiveCreateRequest | New definition of the archive.
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.LogsArchivesApi.UpdateLogsArchive(ctx, archiveId, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LogsArchivesApi.UpdateLogsArchive`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateLogsArchive`: LogsArchive
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from LogsArchivesApi.UpdateLogsArchive:\n%s\n", responseContent)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | Context for authentication, logging, cancellation, deadlines, tracing, etc. | |
archiveId | string | The ID of the archive. | |
body | LogsArchiveCreateRequest | New definition of the archive. |
This endpoint does not have optional parameters.
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
LogsArchiveOrder UpdateLogsArchiveOrder(ctx, body)
Update the order of your archives. Since logs are processed sequentially, reordering an archive may change the structure and content of the data processed by other archives.
Note: Using the PUT
method updates your archive's order by replacing the current order
with the new one.
package main
import (
"context"
"encoding/json"
"fmt"
"os"
datadog "github.com/DataDog/datadog-api-client-go/api/v2/datadog"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
body := *datadog.NewLogsArchiveOrder() // LogsArchiveOrder | An object containing the new ordered list of archive IDs.
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
resp, r, err := apiClient.LogsArchivesApi.UpdateLogsArchiveOrder(ctx, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LogsArchivesApi.UpdateLogsArchiveOrder`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateLogsArchiveOrder`: LogsArchiveOrder
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from LogsArchivesApi.UpdateLogsArchiveOrder:\n%s\n", responseContent)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | Context for authentication, logging, cancellation, deadlines, tracing, etc. | |
body | LogsArchiveOrder | An object containing the new ordered list of archive IDs. |
This endpoint does not have optional parameters.
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]