Share via


Cassandra Clusters - Invoke Command Async

Invoke a command like nodetool for cassandra maintenance asynchronously

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommandAsync?api-version=2025-05-01-preview

URI Parameters

Name In Required Type Description
clusterName
path True

string

minLength: 1
maxLength: 100
pattern: ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$

Managed Cassandra cluster name.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string (uuid)

The ID of the target subscription. The value must be an UUID.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Required Type Description
command True

string

The command which should be run

host True

string

IP address of the cassandra host to run the command on

arguments

object

The arguments for the command to be run

cassandra-stop-start

boolean

If true, stops cassandra before executing the command and then start it again

readWrite

boolean

If true, allows the command to write to the cassandra directory, otherwise read-only.

Responses

Name Type Description
200 OK

CommandPublicResource

The command operation was completed successfully.

202 Accepted

Success. The command operation will begin as soon as possible.

Headers

  • azure-AsyncOperation: string
  • location: string
Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation Impersonate your user account

Examples

CosmosDBManagedCassandraCommandAsync

Sample request

POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cassandra-prod-rg/providers/Microsoft.DocumentDB/cassandraClusters/cassandra-prod/invokeCommandAsync?api-version=2025-05-01-preview

{
  "command": "nodetool",
  "arguments": {
    "status": ""
  },
  "host": "10.0.1.12"
}

Sample response

Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DocumentDB/locations/westeurope/operationsStatus/318653d0-3da5-4814-b8f6-429f2af0b2a4?api-version=2023-03-15-preview
x-ms-request-id: 318653d0-3da5-4814-b8f6-429f2af0b2a4
{
  "command": "nodetool",
  "outputFile": "301fc7c1-397f-4e4a-89db-478f61f89d67",
  "arguments": {
    "status": ""
  },
  "host": "10.0.1.12",
  "isAdmin": false,
  "readWrite": false,
  "cassandraStopStart": false
}

Definitions

Name Description
CommandAsyncPostBody

Specification of which command to run where

CommandPublicResource

resource representing a command

CommandStatus

Status of the command.

ErrorResponse

Error Response.

CommandAsyncPostBody

Specification of which command to run where

Name Type Description
arguments

object

The arguments for the command to be run

cassandra-stop-start

boolean

If true, stops cassandra before executing the command and then start it again

command

string

The command which should be run

host

string

IP address of the cassandra host to run the command on

readWrite

boolean

If true, allows the command to write to the cassandra directory, otherwise read-only.

CommandPublicResource

resource representing a command

Name Type Description
arguments

object

The arguments for the command to be run

cassandraStopStart

boolean

If true, stops cassandra before executing the command and then start it again

command

string

The command which should be run

commandId

string

The unique id of command

host

string

IP address of the cassandra host to run the command on

isAdmin

boolean

Whether command has admin privileges

outputFile

string

The name of the file where the result is written.

readWrite

boolean

If true, allows the command to write to the cassandra directory, otherwise read-only.

result

string

Result output of the command.

status

CommandStatus

Status of the command.

CommandStatus

Status of the command.

Value Description
Done
Running
Enqueue
Processing
Finished
Failed

ErrorResponse

Error Response.

Name Type Description
code

string

Error code.

message

string

Error message indicating why the operation failed.