Chilkat Online Tools

PureBasic / Core Services API / DeleteDedicatedVmHost

Back to Collection Items

IncludeFile "CkHttp.pb"
IncludeFile "CkHttpResponse.pb"

Procedure ChilkatExample()

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

    http.i = CkHttp::ckCreate()
    If http.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    success.i

    CkHttp::ckSetRequestHeader(http,"opc-request-id","8wF")
    CkHttp::ckSetRequestHeader(http,"Authorization","{{signature}}")
    CkHttp::ckSetRequestHeader(http,"Date","{{date}}")

    resp.i = CkHttp::ckQuickRequest(http,"DELETE","https://iaas.{{region}}.oraclecloud.com/20160918/dedicatedVmHosts/:dedicatedVmHostId")
    If CkHttp::ckLastMethodSuccess(http) = 0
        Debug CkHttp::ckLastErrorText(http)
        CkHttp::ckDispose(http)
        ProcedureReturn
    EndIf

    respStatusCode.i = CkHttpResponse::ckStatusCode(resp)
    Debug "Response Status Code = " + Str(respStatusCode)
    If respStatusCode <> 204
        Debug "Response Header:"
        Debug CkHttpResponse::ckHeader(resp)
        Debug "Response Body:"
        Debug CkHttpResponse::ckBodyStr(resp)
        Debug "Failed."
        CkHttpResponse::ckDispose(resp)

        CkHttp::ckDispose(http)
        ProcedureReturn
    EndIf

    CkHttpResponse::ckDispose(resp)

    Debug "Success."


    CkHttp::ckDispose(http)


    ProcedureReturn
EndProcedure

Curl Command

curl -X DELETE
	-H "opc-request-id: 8wF"
	-H "Date: {{date}}"
	-H "Authorization: {{signature}}"
https://iaas.{{region}}.oraclecloud.com/20160918/dedicatedVmHosts/:dedicatedVmHostId

Postman Collection Item JSON

{
  "name": "DeleteDedicatedVmHost",
  "request": {
    "method": "DELETE",
    "header": [
      {
        "description": "Unique identifier for the request.\nIf you need to contact Oracle about a particular request, please provide the request ID.\n",
        "key": "opc-request-id",
        "value": "8wF"
      },
      {
        "key": "Date",
        "value": "{{date}}",
        "description": "(Required) Current Date",
        "type": "text"
      },
      {
        "key": "Authorization",
        "value": "{{signature}}",
        "description": "(Required) Signature Authentication on Authorization header",
        "type": "text"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/dedicatedVmHosts/:dedicatedVmHostId",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "dedicatedVmHosts",
        ":dedicatedVmHostId"
      ],
      "variable": [
        {
          "key": "dedicatedVmHostId",
          "value": "officia sed",
          "description": "(Required) The OCID of the dedicated VM host."
        }
      ]
    },
    "description": "Deletes the specified dedicated virtual machine host.\n\nIf any VM instances are assigned to the dedicated virtual machine host,\nthe delete operation will fail and the service will return a 409 response code.\n"
  },
  "response": [
    {
      "name": "The dedicated virtual machine host is being deleted.",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Unique identifier for the request.\nIf you need to contact Oracle about a particular request, please provide the request ID.\n",
            "key": "opc-request-id",
            "value": "8wF"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/dedicatedVmHosts/:dedicatedVmHostId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "dedicatedVmHosts",
            ":dedicatedVmHostId"
          ],
          "variable": [
            {
              "key": "dedicatedVmHostId"
            }
          ]
        }
      },
      "status": "No Content",
      "code": 204,
      "_postman_previewlanguage": "text",
      "header": [
        {
          "key": "opc-request-id",
          "value": "officia sed",
          "description": "Unique Oracle-assigned identifier for the request. If you need to contact\nOracle about a particular request, please provide the request ID.\n"
        },
        {
          "key": "opc-work-request-id",
          "value": "officia sed",
          "description": "The [OCID](/Content/General/Concepts/identifiers.htm) of the work request. Use [GetWorkRequest](/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest)\nwith this ID to track the status of the request.\n"
        },
        {
          "key": "Content-Type",
          "value": "text/plain"
        }
      ],
      "cookie": [
      ],
      "body": ""
    },
    {
      "name": "Unauthorized",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Unique identifier for the request.\nIf you need to contact Oracle about a particular request, please provide the request ID.\n",
            "key": "opc-request-id",
            "value": "8wF"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/dedicatedVmHosts/:dedicatedVmHostId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "dedicatedVmHosts",
            ":dedicatedVmHostId"
          ],
          "variable": [
            {
              "key": "dedicatedVmHostId"
            }
          ]
        }
      },
      "status": "Unauthorized",
      "code": 401,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "opc-request-id",
          "value": "officia sed",
          "description": "Unique Oracle-assigned identifier for the request. If you need to contact\nOracle about a particular request, please provide the request ID.\n"
        },
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"code\": \"et exercitation Excepteur\",\n \"message\": \"irure sit\"\n}"
    },
    {
      "name": "Not Found",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Unique identifier for the request.\nIf you need to contact Oracle about a particular request, please provide the request ID.\n",
            "key": "opc-request-id",
            "value": "8wF"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/dedicatedVmHosts/:dedicatedVmHostId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "dedicatedVmHosts",
            ":dedicatedVmHostId"
          ],
          "variable": [
            {
              "key": "dedicatedVmHostId"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "opc-request-id",
          "value": "officia sed",
          "description": "Unique Oracle-assigned identifier for the request. If you need to contact\nOracle about a particular request, please provide the request ID.\n"
        },
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"code\": \"et exercitation Excepteur\",\n \"message\": \"irure sit\"\n}"
    },
    {
      "name": "Conflict",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Unique identifier for the request.\nIf you need to contact Oracle about a particular request, please provide the request ID.\n",
            "key": "opc-request-id",
            "value": "8wF"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/dedicatedVmHosts/:dedicatedVmHostId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "dedicatedVmHosts",
            ":dedicatedVmHostId"
          ],
          "variable": [
            {
              "key": "dedicatedVmHostId"
            }
          ]
        }
      },
      "status": "Conflict",
      "code": 409,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "opc-request-id",
          "value": "officia sed",
          "description": "Unique Oracle-assigned identifier for the request. If you need to contact\nOracle about a particular request, please provide the request ID.\n"
        },
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"code\": \"et exercitation Excepteur\",\n \"message\": \"irure sit\"\n}"
    },
    {
      "name": "Internal Server Error",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Unique identifier for the request.\nIf you need to contact Oracle about a particular request, please provide the request ID.\n",
            "key": "opc-request-id",
            "value": "8wF"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/dedicatedVmHosts/:dedicatedVmHostId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "dedicatedVmHosts",
            ":dedicatedVmHostId"
          ],
          "variable": [
            {
              "key": "dedicatedVmHostId"
            }
          ]
        }
      },
      "status": "Internal Server Error",
      "code": 500,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "opc-request-id",
          "value": "officia sed",
          "description": "Unique Oracle-assigned identifier for the request. If you need to contact\nOracle about a particular request, please provide the request ID.\n"
        },
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"code\": \"et exercitation Excepteur\",\n \"message\": \"irure sit\"\n}"
    },
    {
      "name": "An error has occurred.",
      "originalRequest": {
        "method": "DELETE",
        "header": [
          {
            "description": "Unique identifier for the request.\nIf you need to contact Oracle about a particular request, please provide the request ID.\n",
            "key": "opc-request-id",
            "value": "8wF"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/dedicatedVmHosts/:dedicatedVmHostId",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "dedicatedVmHosts",
            ":dedicatedVmHostId"
          ],
          "variable": [
            {
              "key": "dedicatedVmHostId"
            }
          ]
        }
      },
      "status": "Internal Server Error",
      "code": 500,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "opc-request-id",
          "value": "officia sed",
          "description": "Unique Oracle-assigned identifier for the request. If you need to contact\nOracle about a particular request, please provide the request ID.\n"
        },
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n \"code\": \"et exercitation Excepteur\",\n \"message\": \"irure sit\"\n}"
    }
  ]
}