Share feedback
Answers are generated based on the documentation.

Delete rule

DELETE/orgs/{org_name}/governance/policies/{policy_id}/rules/{rule_id}
Deletes a rule from the policy. Returns the deleted rule. Changes may take up to five minutes to reach developer machines.

Connection and access

API connection and authentication guidance

https://hub.docker.com/v2

Use one of these alternatives. Requirements within an alternative apply together.

  • bearerAuth

Parameters

org_name path Required

Docker Hub organization name.

Type: string

All schema constraints and annotations
{
  "type": "string"
}

policy_id path Required

Unique policy identifier.

Type: string

All schema constraints and annotations
{
  "type": "string"
}

rule_id path Required

Unique rule identifier within the policy.

Type: string

All schema constraints and annotations
{
  "type": "string"
}

Request and responses

Response 200

Rule deleted, returns the deleted rule.

application/json

Schema: DeleteRuleResponse

default

{
  "deleted": {
    "actions": [
      "connect:tcp",
      "connect:udp"
    ],
    "decision": "allow",
    "id": "rule_06evsm9qjm1pdsk0a8nkfaxy7jna",
    "name": "allow research mirrors",
    "resources": [
      "research.mitre.org",
      "cve.mitre.org"
    ]
  }
}

Response 401

Missing or invalid credentials

application/json

Schema: Error

default

{
  "error": {
    "code": "unauthenticated",
    "message": "unauthenticated"
  }
}

Response 403

Caller lacks the required permission for this org, or the org is not entitled to use governance.

application/json

Schema: Error

default

{
  "error": {
    "code": "permission_denied",
    "message": "permission denied"
  }
}

Response 404

Not found

application/json

Schema: Error

default

{
  "error": {
    "code": "not_found",
    "message": "policy not found"
  }
}

Response 500

Internal server error

application/json

Schema: Error

default

{
  "error": {
    "code": "internal",
    "message": "internal error"
  }
}

Referenced schemas

#/components/schemas/DeleteRuleResponse

Complete operation contract
{
  "description": "Deletes a rule from the policy. Returns the deleted rule. Changes may\ntake up to five minutes to reach developer machines.\n",
  "operationId": "deleteRule",
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "examples": {
            "default": {
              "value": {
                "deleted": {
                  "actions": [
                    "connect:tcp",
                    "connect:udp"
                  ],
                  "decision": "allow",
                  "id": "rule_06evsm9qjm1pdsk0a8nkfaxy7jna",
                  "name": "allow research mirrors",
                  "resources": [
                    "research.mitre.org",
                    "cve.mitre.org"
                  ]
                }
              }
            }
          },
          "schema": {
            "$ref": "#/components/schemas/DeleteRuleResponse"
          }
        }
      },
      "description": "Rule deleted, returns the deleted rule."
    },
    "401": {
      "$ref": "#/components/responses/Unauthenticated"
    },
    "403": {
      "$ref": "#/components/responses/PermissionDenied"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    }
  },
  "summary": "Delete rule",
  "tags": [
    "rules"
  ]
}