Rubrik Security Cloud API
Getting Started
The Rubrik Security Cloud (RSC) API is GraphQL.
GraphQL Features
- Single Endpoint - The RSC API endpoint will always be /api/graphql.
- Single HTTP method - Everything is an HTTP POST.
- Introspection - The API documentation is built in to the API itself, providing integrated development help and schema checking.
- Customized Response - Queries are customized to only return the fields that is needed.
Help! I'm new to GraphQL!
GraphQL is a "query language," comparable to SQL. In SQL, one might say, "Select name and ID from the VM table." GraphQL is similar in this idea. A query which is much like a SQL table. We then select the properties called fields, which are like columns in that table. Unlike SQL, GraphQL fields can be types with their own fields, allowing a deeply nested structure for more complex objects.
Example
Click on the arrow annotation (1) in the code to see an explanation of that part of the code.
- This is an annotation!
Retrieve all MSSQL databases, and return the name, ID, and the name and ID of the Rubrik Cluster that protect's this MSSQL database.
query mssqlDatabasesExample { #(1)!
mssqlDatabases { # (2)!
nodes { #(3)!
name #(4)!
id
cluster { #(5)!
name #(6)!
id
}
}
}
}
mssqlDatabasesExample
is an operation name, You can change this to whatever you want.mssqlDatabases
is the name of the query in the API.nodes
is a paginated array of objects, in this case, mssqlDatabases.name
is a property, known as afield
in GraphQL. It has a specific type, in this casename
is aString
.cluster
is also a field in the API, but unlikename
that is of typeString
,cluster
is aCluster
type, and it has its own fields.- This is the cluster
name
field. It's a field on theCluster
type in the API.
To learn more about the query syntax, check out GraphQL Language Syntax.
Next: API Playground