Delete Container

On This Page

Description

Deletes a container.

Warning
Take extra care when deleting containers, to avoid data loss or other undesirable consequences. It's recommended that you close all open handles to the container before you delete it. For example, deleting a container without first deleting a Nuclio V3IO volume that references the container might result in consumption of extra Kubernetes resources.

Request

Request Header

Syntax
    DELETE /api/containers/<container> HTTP/1.1
    Host: <management-APIs URL>
    Cookie: session=<cookie>
    
    url = "<management-APIs URL>/api/containers/<container>"
    headers = {"Cookie": "session=<cookie>"}
    
    HTTP Method

    DELETE

    URL Resource Parameters
    <container>

    The ID of the container to delete.

    • Type: Integer
    • Requirement: Required

    Request Data

    None

    Response

    Response Header

    Syntax
    HTTP/1.1 <status code; 200 on success> <reason phrase>
    Content-Type: application/json
    

    Response Data

    Syntax
    {
        "data": {
            "attributes": {
                "container_id": number,
                "job_id":       "string"
            },
            "type": "container_deletion",
            "id": 0
        }
    }
    
    Elements

    The container_id attribute of the response data contains the numeric ID of the deleted container.

    Examples

    Delete a container with ID 1030:

    Request
      DELETE /api/containers/1030 HTTP/1.1
      Host: https://dashboard.default-tenant.app.mycluster.iguazio.com
      Cookie: session=j%3A%7B%22sid%22%3A%20%22a9ce242a-670f-47a8-9c8b-c6730f2794dc%22%7D
      
      import requests
      
      url = "https://dashboard.default-tenant.app.mycluster.iguazio.com/api/containers/1030"
      headers = {"Cookie": "session=j%3A%7B%22sid%22%3A%20%22a9ce242a-670f-47a8-9c8b-c6730f2794dc%22%7D"}
      
      response = requests.delete(url, headers=headers)
      print(response.text)
      
      
      Response
      HTTP/1.1 200 OK
      Content-Type: application/json
      ...
      
      {
          "data": {
              "attributes": {
                  "container_id": 1030,
                  "job_id": "6e7f9bf5-4a7c-4efb-83b7-31785fa82183"
              },
              "type": "container_deletion",
              "id": 0
          }
      }