Index
Retrieving NAS Shares
query {
nasShares(filter: [
{field: NAME_EXACT_MATCH texts: "example"}
{field: IS_RELIC texts: "false"}
{field: IS_REPLICATED texts: "false"}
]) {
nodes {
name
id
cdmId
shareType
exportPoint
isChangelistEnabled
isStale
nasSystem {
name
id
}
nasVolume {
name
id
nasNamespace {
name
id
}
}
primaryFileset {
name
id
}
connectedThrough
hostAddress
hostIdForRestore
cluster {
name
id
}
effectiveSlaDomain {
name
id
}
}
}
}
Retrieving NAS Systems
query {
nasSystems(filter: [
{field: NAME_EXACT_MATCH texts: "example"}
{field: IS_RELIC texts: "false"}
{field: IS_REPLICATED texts: "false"}
]) {
nodes {
name
id
cdmId
osVersion
lastRefreshTime
vendorType
isSmbSupported
isNfsSupported
lastStatus
volumeCount
shareCount
namespaceCount
cluster {
name
id
}
effectiveSlaDomain {
name
id
}
}
}
}
#!/bin/bash
# RSC_TOKEN="YOUR_RSC_ACCESS_TOKEN"
query="query { nasSystems(filter: [ {field: NAME_EXACT_MATCH texts: \\\"example\\\"} {field: IS_RELIC texts: \\\"false\\\"} {field: IS_REPLICATED texts: \\\"false\\\"} ]) { nodes { name id cdmId osVersion lastRefreshTime vendorType isSmbSupported isNfsSupported lastStatus volumeCount shareCount namespaceCount cluster { name id } effectiveSlaDomain { name id } } } }"
# Execute the GraphQL query with curl
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $RSC_TOKEN" \
-d "{\"query\": \"$query\"}" \
https://example.my.rubrik.com/api/graphql
Retrieving NAS Namespaces
$query = New-RscQuery -GqlQuery nasNamespaces
$query.Var.filter = @((Get-RscType -Name Filter),(Get-RscType -Name Filter))
$query.Var.filter[0].field = [RubrikSecurityCloud.Types.HierarchyFilterField]::IS_RELIC
$query.Var.filter[0].texts = "false"
$query.Var.filter[1].field = [RubrikSecurityCloud.Types.HierarchyFilterField]::IS_REPLICATED
$query.Var.filter[1].texts = "false"
$query.field.nodes = @(Get-RscType -Name NasNamespace -InitialProperties `
name,`
id,`
cdmId,`
cluster.name,cluster.id
)
$query.Invoke().nodes
#!/bin/bash
# RSC_TOKEN="YOUR_RSC_ACCESS_TOKEN"
query="query { nasNamespaces(filter: [ {field: NAME_EXACT_MATCH texts: \\\"example\\\"} {field: IS_RELIC texts: \\\"false\\\"} {field: IS_REPLICATED texts: \\\"false\\\"} ]) { nodes { name id cdmId vendorType cluster { name id } effectiveSlaDomain { name id } } } }"
# Execute the GraphQL query with curl
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $RSC_TOKEN" \
-d "{\"query\": \"$query\"}" \
https://example.my.rubrik.com/api/graphql
Retrieving Cloud Direct NAS Shares
query {
cloudDirectNasShares(filter: [
{field: NAME_EXACT_MATCH texts: "example"}
{field: IS_RELIC texts: "false"}
{field: IS_REPLICATED texts: "false"}
]) {
nodes {
name
id
protocol
ncdPolicyName
systemId
namespaceId
cloudDirectId
cloudDirectNasSystem {
name
id
}
cloudDirectNasNamespace {
name
id
}
excludes {
path
pattern
}
cluster {
name
id
}
effectiveSlaDomain {
name
id
}
}
}
}
$query = New-RscQuery -GqlQuery cloudDirectNasShares
$query.Var.filter = @((Get-RscType -Name Filter),(Get-RscType -Name Filter))
$query.Var.filter[0].field = [RubrikSecurityCloud.Types.HierarchyFilterField]::IS_RELIC
$query.Var.filter[0].texts = "false"
$query.Var.filter[1].field = [RubrikSecurityCloud.Types.HierarchyFilterField]::IS_REPLICATED
$query.Var.filter[1].texts = "false"
$query.field.nodes = @(Get-RscType -Name CloudDirectNasShare -InitialProperties `
name,`
id,`
namespaceId,`
protocol,`
ncdPolicyName,`
systemId,`
cloudDirectId,`
cloudDirectNasSystem.name,cloudDirectNasSystem.id,`
cloudDirectNasNamespace.name,cloudDirectNasNamespace.id,`
excludes.path,excludes.pattern,`
shareCount,`
cluster.name,cluster.id
)
$query.Invoke().nodes
#!/bin/bash
# RSC_TOKEN="YOUR_RSC_ACCESS_TOKEN"
query="query { cloudDirectNasShares(filter: [ {field: NAME_EXACT_MATCH texts: \\\"example\\\"} {field: IS_RELIC texts: \\\"false\\\"} {field: IS_REPLICATED texts: \\\"false\\\"} ]) { nodes { name id protocol ncdPolicyName systemId namespaceId cloudDirectId cloudDirectNasSystem { name id } cloudDirectNasNamespace { name id } excludes { path pattern } cluster { name id } effectiveSlaDomain { name id } } } }"
# Execute the GraphQL query with curl
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $RSC_TOKEN" \
-d "{\"query\": \"$query\"}" \
https://example.my.rubrik.com/api/graphql
Retrieving Cloud Direct NAS Systems
query {
nasSystems(filter: [
{field: NAME_EXACT_MATCH texts: "example"}
{field: IS_RELIC texts: "false"}
{field: IS_REPLICATED texts: "false"}
]) {
nodes {
name
id
cdmId
osVersion
lastRefreshTime
vendorType
isSmbSupported
isNfsSupported
lastStatus
volumeCount
shareCount
namespaceCount
cluster {
name
id
}
effectiveSlaDomain {
name
id
}
}
}
}
#!/bin/bash
# RSC_TOKEN="YOUR_RSC_ACCESS_TOKEN"
query="query { nasSystems(filter: [ {field: NAME_EXACT_MATCH texts: \\\"example\\\"} {field: IS_RELIC texts: \\\"false\\\"} {field: IS_REPLICATED texts: \\\"false\\\"} ]) { nodes { name id cdmId osVersion lastRefreshTime vendorType isSmbSupported isNfsSupported lastStatus volumeCount shareCount namespaceCount cluster { name id } effectiveSlaDomain { name id } } } }"
# Execute the GraphQL query with curl
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $RSC_TOKEN" \
-d "{\"query\": \"$query\"}" \
https://example.my.rubrik.com/api/graphql
Retrieving Cloud Direct NAS Namespaces
$query = New-RscQuery -GqlQuery cloudDirectNasNamespaces
$query.Var.filter = @((Get-RscType -Name Filter),(Get-RscType -Name Filter))
$query.Var.filter[0].field = [RubrikSecurityCloud.Types.HierarchyFilterField]::IS_RELIC
$query.Var.filter[0].texts = "false"
$query.Var.filter[1].field = [RubrikSecurityCloud.Types.HierarchyFilterField]::IS_REPLICATED
$query.Var.filter[1].texts = "false"
$query.field.nodes = @(Get-RscType -Name CloudDirectNasNamespace -InitialProperties `
name,`
id,`
cloudDirectId,`
cloudDirectNasSystem.name,cloudDirectNasSystem.id,`
shareCount,`
cluster.name,cluster.id,`
effectiveSlaDomain.name,effectiveSlaDomain.id
)
$query.Invoke().nodes
#!/bin/bash
# RSC_TOKEN="YOUR_RSC_ACCESS_TOKEN"
query="query { cloudDirectNasNamespaces(filter: [ {field: NAME_EXACT_MATCH texts: \\\"example\\\"} {field: IS_RELIC texts: \\\"false\\\"} {field: IS_REPLICATED texts: \\\"false\\\"} ]) { nodes { name id cloudDirectId cloudDirectNasSystem { name id } shareCount cluster { name id } effectiveSlaDomain { name id } } } }"
# Execute the GraphQL query with curl
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $RSC_TOKEN" \
-d "{\"query\": \"$query\"}" \
https://example.my.rubrik.com/api/graphql