Skip to main content
Version: 1.0.0

Create policy

POST 

/metalakes/:metalake/policies

Create policy

Request

Path Parameters

    metalake stringrequired

    The name of the metalake

Body

    oneOf

    A request to create a policy with a custom content structure.

    name stringrequired

    The name of the policy

    comment stringnullable

    A comment for the policy

    policyType stringrequired

    The type of the policy

    enabled boolean

    Default value: true

    Whether the policy is enabled

    content

    object

    required

    Content for a custom policy type.

    supportedObjectTypes string[]required

    Possible values: [CATALOG, SCHEMA, TABLE, FILESET, TOPIC, MODEL], >= 1

    The types of metadata objects this policy content can be applied to.

    properties

    object

    A map of string-to-string properties for the policy content.

    property name* string
    customRules object

    A map of custom rules where the key is the rule name and the value can be of any type.

Responses

Returns the created policy object

Schema

    code int32

    Possible values: [0]

    Status code of the response

    policy

    object

    A basic policy without content

    oneOf

    A policy with custom content

    name stringrequired

    The name of the policy

    comment stringnullable

    A comment about the policy

    policyType stringrequired

    The type of the policy

    enabled booleanrequired

    Whether the policy is enabled

    audit

    object

    required

    Audit information for a Gravitino resource.

    creator string

    The user who created the resource

    createTime date-time

    The time the resource was created

    lastModifier string

    The user who last modified the resource

    lastModifiedTime date-time

    The time the resource was last modified

    inherited booleannullable

    Whether the policy is inherited from the parent metadata object

    content

    object

    required

    Content for a custom policy type.

    supportedObjectTypes string[]required

    Possible values: [CATALOG, SCHEMA, TABLE, FILESET, TOPIC, MODEL], >= 1

    The types of metadata objects this policy content can be applied to.

    properties

    object

    A map of string-to-string properties for the policy content.

    property name* string
    customRules object

    A map of custom rules where the key is the rule name and the value can be of any type.

Loading...