Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
© 2022 Yandex.Cloud LLC
Yandex Managed Service for Apache Kafka®
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Information about existing clusters
    • Creating clusters
    • Connecting to clusters
    • Stopping and starting clusters
    • Changing cluster settings
    • Managing Apache Kafka® hosts
    • Working with topics and partitions
    • Managing Kafka accounts
    • Managing connectors
    • Viewing cluster logs
    • Deleting a cluster
    • Monitoring the state of a cluster and hosts
  • Practical guidelines
    • All use cases
    • Data delivery in Managed Service for ClickHouse
    • Configuring Kafka Connect for Managed Service for Apache Kafka®
    • Data delivery in ksqlDB
    • Using Confluent Schema Registry with Managed Service for Apache Kafka®
    • Migrating with MirrorMaker 2.0
    • Delivering data using Debezium
  • Concepts
    • Relationship between service resources
    • Topics and partitions
    • Brokers
    • Producers and consumers
    • Managing data schemas
    • Host classes
    • Network in Managed Service for Apache Kafka®
    • Quotas and limits
    • Storage types
    • Connectors
    • Apache Kafka® settings
  • Access management
  • Pricing policy
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • ClusterService
      • ConnectorService
      • ResourcePresetService
      • TopicService
      • UserService
      • OperationService
    • REST
      • Overview
      • Cluster
        • Overview
        • create
        • delete
        • get
        • list
        • listHosts
        • listLogs
        • listOperations
        • move
        • rescheduleMaintenance
        • start
        • stop
        • streamLogs
        • update
      • Connector
        • Overview
        • create
        • delete
        • get
        • list
        • pause
        • resume
        • update
      • ResourcePreset
        • Overview
        • get
        • list
      • Topic
        • Overview
        • create
        • delete
        • get
        • list
        • update
      • User
        • Overview
        • create
        • delete
        • get
        • grantPermission
        • list
        • revokePermission
        • update
      • Operation
        • Overview
        • get
  • Questions and answers
  1. API reference
  2. REST
  3. User
  4. grantPermission

Method grantPermission

Written by
Yandex Cloud
  • HTTP request
  • Path parameters
  • Body parameters
  • Response

Grants permission to the specified Kafka user.

HTTP request

POST https://mdb.api.cloud.yandex.net/managed-kafka/v1/clusters/{clusterId}/users/{userName}:grantPermission

Path parameters

Parameter Description
clusterId Required. ID of the Apache Kafka® cluster the user belongs to. To get the cluster ID, make a list request. The maximum string length in characters is 50.
userName Required. Name of the user to grant the permission to. To get the name of the user, make a list request. The string length in characters must be 1-63. Value must match the regular expression [a-zA-Z0-9_]*.

Body parameters

{
  "permission": {
    "topicName": "string",
    "role": "string"
  }
}
Field Description
permission object

Required. Permission that should be granted to the specified user.

permission.
topicName
string

Name or prefix-pattern with wildcard for the topic that the permission grants access to.

To get the topic name, make a list request.

permission.
role
string

Access role type to grant to the user.

  • ACCESS_ROLE_PRODUCER: producer role for the user.
  • ACCESS_ROLE_CONSUMER: consumer role for the user.
  • ACCESS_ROLE_ADMIN: admin role for the user.

Response

HTTP Code: 200 - OK

{
  "id": "string",
  "description": "string",
  "createdAt": "string",
  "createdBy": "string",
  "modifiedAt": "string",
  "done": true,
  "metadata": "object",

  //  includes only one of the fields `error`, `response`
  "error": {
    "code": "integer",
    "message": "string",
    "details": [
      "object"
    ]
  },
  "response": "object",
  // end of the list of possible fields

}

An Operation resource. For more information, see Operation.

Field Description
id string

ID of the operation.

description string

Description of the operation. 0-256 characters long.

createdAt string (date-time)

Creation timestamp.

String in RFC3339 text format.

createdBy string

ID of the user or service account who initiated the operation.

modifiedAt string (date-time)

The time when the Operation resource was last modified.

String in RFC3339 text format.

done boolean (boolean)

If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.

metadata object

Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.

error object
The error result of the operation in case of failure or cancellation.
includes only one of the fields error, response

The error result of the operation in case of failure or cancellation.

error.
code
integer (int32)

Error code. An enum value of google.rpc.Code.

error.
message
string

An error message.

error.
details[]
object

A list of messages that carry the error details.

response object
includes only one of the fields error, response

The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is the standard Create/Update, the response should be the target resource of the operation. Any method that returns a long-running operation should document the response type, if any.

Was the article helpful?

Language / Region
© 2022 Yandex.Cloud LLC
In this article:
  • HTTP request
  • Path parameters
  • Body parameters
  • Response