Sha256: 04e41aa1b80f6d786b8930d3188136ff19bd05d80de5f1db8bc8e268ce654584

Contents?: true

Size: 1.77 KB

Versions: 19

Compression:

Stored size: 1.77 KB

Contents

# Create, update, and delete incident attachments returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.update_incident_attachments".to_sym] = true
end
api_instance = DatadogAPIClient::V2::IncidentsAPI.new

body = DatadogAPIClient::V2::IncidentAttachmentUpdateRequest.new({
  data: [
    DatadogAPIClient::V2::IncidentAttachmentUpdateData.new({
      attributes: DatadogAPIClient::V2::IncidentAttachmentPostmortemAttributes.new({
        attachment: DatadogAPIClient::V2::IncidentAttachmentsPostmortemAttributesAttachmentObject.new({
          document_url: "https://app.datadoghq.com/notebook/123",
          title: "Postmortem IR-123",
        }),
        attachment_type: DatadogAPIClient::V2::IncidentAttachmentPostmortemAttachmentType::POSTMORTEM,
      }),
      id: "00000000-abcd-0002-0000-000000000000",
      type: DatadogAPIClient::V2::IncidentAttachmentType::INCIDENT_ATTACHMENTS,
    }),
    DatadogAPIClient::V2::IncidentAttachmentUpdateData.new({
      attributes: DatadogAPIClient::V2::IncidentAttachmentLinkAttributes.new({
        attachment: DatadogAPIClient::V2::IncidentAttachmentLinkAttributesAttachmentObject.new({
          document_url: "https://www.example.com/webstore-failure-runbook",
          title: "Runbook for webstore service failures",
        }),
        attachment_type: DatadogAPIClient::V2::IncidentAttachmentLinkAttachmentType::LINK,
      }),
      type: DatadogAPIClient::V2::IncidentAttachmentType::INCIDENT_ATTACHMENTS,
    }),
    DatadogAPIClient::V2::IncidentAttachmentUpdateData.new({
      id: "00000000-abcd-0003-0000-000000000000",
      type: DatadogAPIClient::V2::IncidentAttachmentType::INCIDENT_ATTACHMENTS,
    }),
  ],
})
p api_instance.update_incident_attachments("incident_id", body)

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
datadog_api_client-2.28.1 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.27.1 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.26.1 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.26.0 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.25.0 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.24.0 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.22.0 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.21.0 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.20.0 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.19.0 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.18.0 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.17.0 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.16.0 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.15.0 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.14.0 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.13.0 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.12.0 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.11.0 examples/v2/incidents/UpdateIncidentAttachments.rb
datadog_api_client-2.10.0 examples/v2/incidents/UpdateIncidentAttachments.rb