2.2.0 • Published 8 months ago

@dynatrace-sdk/client-bucket-management v2.2.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
8 months ago

@dynatrace-sdk/client-bucket-management

npm License

Here you can find the

  • The Dynatrace Bucket Management API for Grail. Get more information about use cases and examples from the Dynatrace Documentation

Installation

npm install @dynatrace-sdk/client-bucket-management

Getting help

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

API reference

Full API reference for the latest version of the SDK is also available at the Dynatrace Developer.

bucketDefinitionsClient

import { bucketDefinitionsClient } from '@dynatrace-sdk/client-bucket-management';

createBucket

Create a new bucket

Create a new bucket. Bucket creation can take up to 1 minute.

Required scope: storage:bucket-definitions:write

Parameters

NameType
config.body*requiredNewBucket

Returns

Successfully created bucket definition

Throws

Error TypeError Message
ErrorEnvelopeErrorbad request | unauthorized | missing permissions | Bucket already exists
import { bucketDefinitionsClient } from "@dynatrace-sdk/client-bucket-management";

const data = await bucketDefinitionsClient.createBucket({
  body: {
    bucketName: "custom_logs",
    table: "logs",
    displayName: "Custom logs bucket",
    retentionDays: 35,
  },
});

deleteBucket

Delete a bucket

Starts deleting a bucket.

Deletes the bucket and all data stored in the bucket. This operation can not be undone.

Required scope: storage:bucket-definitions:delete

Parameters

NameType
config.bucketName*requiredstring

Returns

accepted delete bucket

Throws

Error TypeError Message
ErrorEnvelopeErrorbad request | unauthorized | Forbidden | bucket not found | another operation is still in progress that prevents deletion.
import { bucketDefinitionsClient } from "@dynatrace-sdk/client-bucket-management";

const data = await bucketDefinitionsClient.deleteBucket({
  bucketName: "...",
});

getDefinition

Get bucket definition by name

Get bucket definition by name.

Newly created buckets are not shown immediately, this can take up to a minute.

Required scope: storage:bucket-definitions:read

Parameters

NameTypeDescription
config.addFieldsArray<string>Define additional fields added to the response. Depending on the field this may result in longer response times. records: Request number of records stored in a bucket. estimatedUncompressedBytes: Request estimated uncompressed size of a bucket.
config.bucketName*requiredstring

Returns

Successfully retrieved bucket definition.

Throws

Error TypeError Message
ErrorEnvelopeErrorbad request | unauthorized | missing permissions | Bucket with provided name was not found.
import { bucketDefinitionsClient } from "@dynatrace-sdk/client-bucket-management";

const data = await bucketDefinitionsClient.getDefinition({
  bucketName: "...",
});

getDefinitions

Get all bucket definitions

Get all bucket definitions.

Newly created buckets are not shown immediately, this can take up to a minute.

Required scope: storage:bucket-definitions:read

Parameters

NameTypeDescription
config.addFieldsArray<string>Define additional fields added to the response. Depending on the field this may result in longer response times. records: Request number of records stored in a bucket. estimatedUncompressedBytes: Request estimated uncompressed size of a bucket.

Returns

Successfully retrieved all bucket definitions

Throws

Error TypeError Message
ErrorEnvelopeErrorbad request | unauthorized | missing permissions
import { bucketDefinitionsClient } from "@dynatrace-sdk/client-bucket-management";

const data = await bucketDefinitionsClient.getDefinitions();

truncateBucket

Truncate a bucket

Truncate a specific bucket. Removes the content of the given bucket. Operation can be executed with all types of buckets.

Required scope: storage:bucket-definitions:truncate

Parameters

NameType
config.bucketName*requiredstring

Throws

Error TypeError Message
ErrorEnvelopeErrorbad request | unauthorized | Forbidden | Bucket not found | Server not ready
import { bucketDefinitionsClient } from "@dynatrace-sdk/client-bucket-management";

const data = await bucketDefinitionsClient.truncateBucket({
  bucketName: "...",
});

updateBucket

Update a bucket

Update a bucket. Update one of the following fields or both:

  • displayName: descriptive name of the bucket
  • retentionDays: retention period in days (important note: the new retention days will also apply to existing records. Shortening the retention period could result in data deletion!)

Define the full bucket definition with updated field(s) in the request body.

Required scope: storage:bucket-definitions:write.

Parameters

NameTypeDescription
config.body*requiredUpdateBucket
config.bucketName*requiredstring
config.optimisticLockingVersion*requirednumberDefine on which version the updated data is based on.

Throws

Error TypeError Message
ErrorEnvelopeErrorbad request | unauthorized | Forbidden | Bucket with provided name was not found | Attempt to update an old version or an operation is currently in progress that prevents current modifications (creating, deleting, updating)
import { bucketDefinitionsClient } from "@dynatrace-sdk/client-bucket-management";

const data = await bucketDefinitionsClient.updateBucket({
  bucketName: "...",
  optimisticLockingVersion: 10,
  body: {
    bucketName: "custom_logs",
    table: "logs",
    displayName: "Custom logs bucket (updated)",
    status: "active",
    retentionDays: 10,
    version: 1,
  },
});

updateBucketPartially

Update a bucket partially

Update a bucket. Update one of the following fields or both:

  • displayName: descriptive name of the bucket
  • retentionDays: retention period in days (important note: the new retention days will also apply to existing records. Shortening the retention period could result in data deletion!)

Add the field(s) to be updated to the request body.

Required scope: storage:bucket-definitions:write

Parameters

NameTypeDescription
config.body*requiredPartialUpdateBucket
config.bucketName*requiredstring
config.optimisticLockingVersion*requirednumberDefine on which version the updated data is based on.

Throws

Error TypeError Message
ErrorEnvelopeErrorbad request | unauthorized | Forbidden | Bucket with provided name was not found | Attempt to update an old version or an operation is currently in progress that prevents current modifications (creating, deleting, updating)
import { bucketDefinitionsClient } from "@dynatrace-sdk/client-bucket-management";

const data =
  await bucketDefinitionsClient.updateBucketPartially({
    bucketName: "...",
    optimisticLockingVersion: 10,
    body: {
      displayName: "Custom logs bucket (updated)",
      retentionDays: 10,
    },
  });

Types

ApiClientError

Base error for all client SDKs. All other errors extend this class.

NameTypeDescription
causeany
errorType*requiredErrorType
isApiClientError*requiredtrue
message*requiredstring
name*requiredstring
stackstring
prepareStackTraceObjectOptional override for formatting stack traces
stackTraceLimit*requirednumber

ApiGatewayError

Dedicated error response class for errors thrown by API Gateway. Autogenerated SDK Clients have built-in handler for API Gateway errors that throws this error.

NameTypeDescription
body*requiredApiGatewayErrorResponseBody
causeany
code*requirednumber
errorType*requiredErrorType
isApiClientError*requiredtrue
isApiGatewayError*requiredtrue
isClientRequestError*requiredtrue
message*requiredstring
name*requiredstring
response*requiredHttpClientResponse
retryAfterSeconds*requiredundefined | number
stackstring
prepareStackTraceObjectOptional override for formatting stack traces
stackTraceLimit*requirednumber

ClientRequestError

Generic error class for service errors, used to handle both expected and unexpected service-level errors.

NameTypeDescription
body*requiredDTO
causeany
errorType*requiredErrorType
isApiClientError*requiredtrue
isClientRequestError*requiredtrue
message*requiredstring
name*requiredstring
response*requiredHttpClientResponse
stackstring
prepareStackTraceObjectOptional override for formatting stack traces
stackTraceLimit*requirednumber

ErrorEnvelopeError

Generic error class for service errors, used to handle both expected and unexpected service-level errors.

NameTypeDescription
body*requiredErrorEnvelope
causeany
errorType*requiredErrorType
isApiClientError*requiredtrue
isClientRequestError*requiredtrue
isErrorEnvelopeError*requiredtrue
message*requiredstring
name*requiredstring
response*requiredHttpClientResponse
stackstring
prepareStackTraceObjectOptional override for formatting stack traces
stackTraceLimit*requirednumber

InvalidResponseError

Dedicated error class for errors related to response serialization. Thrown when received service response can't be deserialized.

NameTypeDescription
causeany
errorType*requiredErrorType
expectedTypestring
isApiClientError*requiredtrue
isInvalidResponseError*requiredtrue
message*requiredstring
name*requiredstring
nestedErrorError
response*requiredany
responseBody*requiredany
stackstring
prepareStackTraceObjectOptional override for formatting stack traces
stackTraceLimit*requirednumber

Bucket

NameTypeDescription
bucketName*requiredstringThe unique identifier of the bucket within the tenant.
displayNamestringDescriptive name of the bucket. No restriction regarding unique naming or valid characters.
estimatedUncompressedBytesnumberEstimated uncompressed size of the bucket in bytes.
metricIntervalBucketMetricIntervalInterval of aggregated metric data. Only applies to metric buckets.
recordsnumberAmount of records in the bucket.
retentionDays*requirednumberThe retention period in days of the data in the bucket.
status*requiredBucketStatusThe current status of the bucket, depending on bucket lifecycle.
table*requiredstringName of the table the bucket is assigned to.
updatable*requiredbooleanA flag indicating whether a bucket can be updated or not.
version*requirednumberOptimistic locking version. Update requests define with this on which version the data updated is based on. This must match with the version stored, otherwise the update will fail due to concurrent modification.

Buckets

NameType
buckets*requiredArray<Bucket>

CustomValidationErrorInfo

NameType
messagestring

ErrorEnvelope

NameType
errorExceptionalReturn

ErrorInfo

NameType
messagestring

ExceptionalReturn

NameType
codenumber
errorDetailsArray<CustomValidationErrorInfo | InvalidAuditEventsErrorInfo | MediaTypeErrorInfo | ParameterErrorInfo | ProxyErrorInfo | QueryFrontendRawErrorInfo | RequestBodyErrorInfo>
messagestring

InvalidAuditEventsErrorInfo

NameType
invalidAuditEventIndicesArray<number>
invalidEventIndicesArray<number>
messagestring

MediaTypeErrorInfo

NameType
messagestring
supportedMediaTypesArray<string>

NewBucket

NameTypeDescription
bucketName*requiredstringThe unique identifier of the bucket within the tenant.
displayNamestringDescriptive name of the bucket. No restriction regarding unique naming or valid characters.
metricIntervalNewBucketMetricIntervalInterval of aggregated metric data. Only applies to metric buckets.
retentionDays*requirednumberThe retention period in days of the data in the bucket.
table*requiredstringName of the table the bucket is assigned to. One of logs, events, bizevents

ParameterErrorInfo

NameType
messagestring
parameterDescriptorstring

PartialUpdateBucket

NameTypeDescription
displayNamestringDescriptive name of the bucket. No restriction regarding unique naming or valid characters.
retentionDaysnumberThe retention period in days of the data in the bucket. Important note: the new retention days will also apply to existing records. Shortening the retention period could result in data deletion!

ProxyErrorInfo

NameType
messagestring

QueryFrontendRawErrorInfo

NameType
messagestring
rawQueryFrontendResponsestring

RequestBodyErrorInfo

NameType
bodyDescriptorstring
messagestring

UpdateBucket

NameTypeDescription
bucketName*requiredstringThe unique identifier of the bucket within the tenant.
displayNamestringDescriptive name of the bucket. No restriction regarding unique naming or valid characters.
metricIntervalUpdateBucketMetricIntervalMetric interval for metric buckets. Will be ignored for other buckets.
retentionDays*requirednumberThe retention period in days of the data in the bucket. Important note: the new retention days will also apply to existing records. Shortening the retention period could result in data deletion!
status*requiredUpdateBucketStatusThe current status of the bucket, depending on bucket lifecycle.
table*requiredUpdateBucketTableName of the table the bucket is assigned to.
version*requirednumberOptimistic locking version. Update requests define with this on which version the data updated is based on. This must match with the version stored, otherwise the update will fail due to concurrent modification.

Enums

BucketMetricInterval

Interval of aggregated metric data. Only applies to metric buckets.

Enum keys

Pt10S | Pt15M | Pt1H | Pt1M | Pt1S | Pt5M | Pt5S

BucketStatus

The current status of the bucket, depending on bucket lifecycle.

Enum keys

Active | Creating | Deleting | Updating

NewBucketMetricInterval

Interval of aggregated metric data. Only applies to metric buckets.

Enum keys

Pt15M | Pt1H | Pt1M | Pt5M

UpdateBucketMetricInterval

Metric interval for metric buckets. Will be ignored for other buckets.

Enum keys

Pt15M | Pt1H | Pt1M | Pt5M

UpdateBucketStatus

The current status of the bucket, depending on bucket lifecycle.

Enum keys

Active | Creating | Deleting | Updating

UpdateBucketTable

Name of the table the bucket is assigned to.

Enum keys

Bizevents | Events | Logs

2.2.0

8 months ago

2.0.7

1 year ago

2.0.9

12 months ago

2.0.8

12 months ago

2.1.0

9 months ago

2.0.6

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.6

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago