Chilkat Online Tools

PowerBuilder / Datadog API Collection / Remove host tags

Back to Collection Items

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Resp
integer li_RespStatusCode

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

loo_Http = create oleobject
li_rc = loo_Http.ConnectToNewObject("Chilkat_9_5_0.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

loo_Http.SetRequestHeader("Accept","application/json")

loo_Resp = loo_Http.QuickRequest("DELETE","velit")
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    return
end if

li_RespStatusCode = loo_Resp.StatusCode
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode <> 204 then
    Write-Debug "Response Header:"
    Write-Debug loo_Resp.Header
    Write-Debug "Response Body:"
    Write-Debug loo_Resp.BodyStr
    Write-Debug "Failed."
    destroy loo_Resp
    destroy loo_Http
    return
end if

destroy loo_Resp
Write-Debug "Success."


destroy loo_Http

Curl Command

curl -X DELETE
	-H "Accept: application/json"
https://api.app.ddog-gov.com/api/v1/tags/hosts/:host_name?source=tempor Ut sed velit

Postman Collection Item JSON

{
  "name": "Remove host tags",
  "request": {
    "method": "DELETE",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/api/v1/tags/hosts/:host_name?source=tempor Ut sed velit",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v1",
        "tags",
        "hosts",
        ":host_name"
      ],
      "query": [
        {
          "key": "source",
          "value": "tempor Ut sed velit",
          "description": "The source of the tags (for example chef, puppet).\n[Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value)."
        }
      ],
      "variable": [
        {
          "key": "host_name",
          "value": "tempor Ut sed velit"
        }
      ]
    },
    "description": "This endpoint allows you to remove all user-assigned tags\nfor a single host."
  },
  "response": [
    {
      "name": "OK",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v1/tags/hosts/:host_name?source=tempor Ut sed velit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "tags",
            "hosts",
            ":host_name"
          ],
          "query": [
            {
              "key": "source",
              "value": "tempor Ut sed velit",
              "description": "The source of the tags (for example chef, puppet).\n[Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value)."
            }
          ],
          "variable": [
            {
              "key": "host_name"
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "text",
      "header": [
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "Forbidden",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v1/tags/hosts/:host_name?source=tempor Ut sed velit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "tags",
            "hosts",
            ":host_name"
          ],
          "query": [
            {
              "key": "source",
              "value": "tempor Ut sed velit",
              "description": "The source of the tags (for example chef, puppet).\n[Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value)."
            }
          ],
          "variable": [
            {
              "key": "host_name"
            }
          ]
        }
      },
      "status": "Forbidden",
      "code": 403,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"Bad Request\",\n    \"Bad Request\"\n  ]\n}"
    },
    {
      "name": "Not Found",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v1/tags/hosts/:host_name?source=tempor Ut sed velit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "tags",
            "hosts",
            ":host_name"
          ],
          "query": [
            {
              "key": "source",
              "value": "tempor Ut sed velit",
              "description": "The source of the tags (for example chef, puppet).\n[Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value)."
            }
          ],
          "variable": [
            {
              "key": "host_name"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"Bad Request\",\n    \"Bad Request\"\n  ]\n}"
    },
    {
      "name": "Too many requests",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v1/tags/hosts/:host_name?source=tempor Ut sed velit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "tags",
            "hosts",
            ":host_name"
          ],
          "query": [
            {
              "key": "source",
              "value": "tempor Ut sed velit",
              "description": "The source of the tags (for example chef, puppet).\n[Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value)."
            }
          ],
          "variable": [
            {
              "key": "host_name"
            }
          ]
        }
      },
      "status": "Too Many Requests",
      "code": 429,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"Bad Request\",\n    \"Bad Request\"\n  ]\n}"
    }
  ]
}