Rubrik SDK for PowerShell
master
master
  • README
  • User Documentation
    • Contribution
    • FAQ
    • Getting Started
    • Installation
    • Licensing
    • Project Architecture
    • Requirements
    • Support
  • Command Documentation
    • Workflow
      • Flow Audit
    • Reference
      • Connect-Rubrik
      • Disconnect-Rubrik
      • Export-RubrikDatabase
      • Export-RubrikReport
      • Export-RubrikVApp
      • Export-RubrikVCDTemplate
      • Export-RubrikVM
      • Find-RubrikFile
      • Get-RubrikAPIToken
      • Get-RubrikAPIVersion
      • Get-RubrikArchive
      • Get-RubrikAvailabilityGroup
      • Get-RubrikBackupServiceDeployment
      • Get-RubrikBlackout
      • Get-RubrikBootStrap
      • Get-RubrikClusterInfo
      • Get-RubrikClusterNetworkInterface
      • Get-RubrikClusterStorage
      • Get-RubrikClusterUpgradeHistory
      • Get-RubrikDatabase
      • Get-RubrikDatabaseDownloadLink
      • Get-RubrikDatabaseFiles
      • Get-RubrikDatabaseMount
      • Get-RubrikDatabaseRecoverableRange
      • Get-RubrikDatabaseRecoveryPoint
      • Get-RubrikDebugInfo
      • Get-RubrikDNSSetting
      • Get-RubrikDownloadLink
      • Get-RubrikEmailSetting
      • Get-RubrikEvent
      • Get-RubrikEventSeries
      • Get-RubrikFileset
      • Get-RubrikFilesetTemplate
      • Get-RubrikGuestOSCredential
      • Get-RubrikHost
      • Get-RubrikHostVolume
      • Get-RubrikHvmFormatAutoUpgrade
      • Get-RubrikHvmFormatClusterStorage
      • Get-RubrikHvmFormatReport
      • Get-RubrikHvmFormatUpgradeReport
      • Get-RubrikHyperVHost
      • Get-RubrikHyperVMount
      • Get-RubrikHyperVVM
      • Get-RubrikIPMI
      • Get-RubrikLDAP
      • Get-RubrikLoginBanner
      • Get-RubrikLogShipping
      • Get-RubrikManagedVolume
      • Get-RubrikManagedVolumeExport
      • Get-RubrikModuleDefaultParameter
      • Get-RubrikModuleOption
      • Get-RubrikMount
      • Get-RubrikNASShare
      • Get-RubrikNetworkThrottle
      • Get-RubrikNfsArchive
      • Get-RubrikNode
      • Get-RubrikNotificationSetting
      • Get-RubrikNTPServer
      • Get-RubrikNutanixCluster
      • Get-RubrikNutanixVM
      • Get-RubrikObject
      • Get-RubrikObjectStoreArchive
      • Get-RubrikOracleDB
      • Get-RubrikOrganization
      • Get-RubrikOrgAuthorization
      • Get-RubrikProxySetting
      • Get-RubrikQstarArchive
      • Get-RubrikReplicationSource
      • Get-RubrikReplicationTarget
      • Get-RubrikReport
      • Get-RubrikReportData
      • Get-RubrikRequest
      • Get-RubrikScvmm
      • Get-RubrikSecurityClassification
      • Get-RubrikSetting
      • Get-RubrikSLA
      • Get-RubrikSmbDomain
      • Get-RubrikSmbSecurity
      • Get-RubrikSnapshot
      • Get-RubrikSNMPSetting
      • Get-RubrikSoftwareVersion
      • Get-RubrikSQLInstance
      • Get-RubrikSupportTunnel
      • Get-RubrikSyslogServer
      • Get-RubrikUnmanagedObject
      • Get-RubrikUser
      • Get-RubrikUserRole
      • Get-RubrikVApp
      • Get-RubrikVAppExportOption
      • Get-RubrikVAppRecoverOption
      • Get-RubrikVAppSnapshot
      • Get-RubrikVCD
      • Get-RubrikVCDTemplateExportOption
      • Get-RubrikVCenter
      • Get-RubrikVersion
      • Get-RubrikVgfAutoUpgrade
      • Get-RubrikVgfClusterStorage
      • Get-RubrikVgfReport
      • Get-RubrikVgfUpgradeReport
      • Get-RubrikVM
      • Get-RubrikVMSnapshot
      • Get-RubrikVMwareCluster
      • Get-RubrikVMwareDatacenter
      • Get-RubrikVMwareDatastore
      • Get-RubrikVMwareHost
      • Get-RubrikVolumeGroup
      • Get-RubrikVolumeGroupMount
      • Invoke-RubrikGraphQLCall
      • Invoke-RubrikHvmFormatUpgrade
      • Invoke-RubrikRESTCall
      • Invoke-RubrikVgfUpgrade
      • Move-RubrikMountVMDK
      • New-RubrikAPIToken
      • New-RubrikBootStrap
      • New-RubrikDatabaseMount
      • New-RubrikFileset
      • New-RubrikFilesetTemplate
      • New-RubrikHost
      • New-RubrikHyperVVMMount
      • New-RubrikLDAP
      • New-RubrikLogBackup
      • New-RubrikLogShipping
      • New-RubrikManagedVolume
      • New-RubrikManagedVolumeExport
      • New-RubrikMount
      • New-RubrikNASShare
      • New-RubrikOrganization
      • New-RubrikReport
      • New-RubrikSLA
      • New-RubrikSnapshot
      • New-RubrikUser
      • New-RubrikVCenter
      • New-RubrikVMDKMount
      • New-RubrikVolumeGroupMount
      • Protect-RubrikDatabase
      • Protect-RubrikFileset
      • Protect-RubrikHyperVVM
      • Protect-RubrikNutanixVM
      • Protect-RubrikTag
      • Protect-RubrikVApp
      • Protect-RubrikVM
      • Protect-RubrikVolumeGroup
      • Register-RubrikBackupService
      • Remove-RubrikAPIToken
      • Remove-RubrikDatabaseMount
      • Remove-RubrikDatabaseSnapshots
      • Remove-RubrikFileset
      • Remove-RubrikFilesetSnapshot
      • Remove-RubrikFilesetTemplate
      • Remove-RubrikHost
      • Remove-RubrikHyperVMount
      • Remove-RubrikHyperVSnapshot
      • Remove-RubrikLogShipping
      • Remove-RubrikManagedVolume
      • Remove-RubrikManagedVolumeExport
      • Remove-RubrikManagedVolumeSnapshot
      • Remove-RubrikModuleDefaultParameter
      • Remove-RubrikMount
      • Remove-RubrikNASShare
      • Remove-RubrikNutanixVMSnapshot
      • Remove-RubrikOrganization
      • Remove-RubrikOrgAuthorization
      • Remove-RubrikProxySetting
      • Remove-RubrikReport
      • Remove-RubrikSLA
      • Remove-RubrikUnmanagedObject
      • Remove-RubrikUser
      • Remove-RubrikVCenter
      • Remove-RubrikVMSnapshot
      • Remove-RubrikVolumeGroupMount
      • Remove-RubrikVolumeGroupSnapshot
      • Reset-RubrikLogShipping
      • Restore-RubrikDatabase
      • Restore-RubrikVApp
      • Resume-RubrikSLA
      • Set-RubrikAvailabilityGroup
      • Set-RubrikBlackout
      • Set-RubrikDatabase
      • Set-RubrikHvmFormatAutoUpgrade
      • Set-RubrikHyperVVM
      • Set-RubrikLogShipping
      • Set-RubrikManagedVolume
      • Set-RubrikModuleDefaultParameter
      • Set-RubrikModuleOption
      • Set-RubrikMount
      • Set-RubrikNASShare
      • Set-RubrikNutanixVM
      • Set-RubrikOrgAuthorization
      • Set-RubrikProxySetting
      • Set-RubrikReport
      • Set-RubrikSetting
      • Set-RubrikSLA
      • Set-RubrikSQLInstance
      • Set-RubrikSupportTunnel
      • Set-RubrikUser
      • Set-RubrikUserRole
      • Set-RubrikVCD
      • Set-RubrikVCenter
      • Set-RubrikVgfAutoUpgrade
      • Set-RubrikVM
      • Set-RubrikVolumeFilterDriver
      • Start-RubrikDownload
      • Start-RubrikManagedVolumeSnapshot
      • Stop-RubrikManagedVolumeSnapshot
      • Suspend-RubrikSLA
      • Sync-RubrikAnnotation
      • Sync-RubrikTag
      • Test-RubrikSnapshotVerification
      • Update-RubrikHost
      • Update-RubrikNutanixCluster
      • Update-RubrikVCD
      • Update-RubrikVCenter
      • Update-RubrikVMwareVM
Powered by GitBook
On this page
  • SYNOPSIS
  • SYNTAX
  • Default
  • Node
  • JSON
  • DESCRIPTION
  • EXAMPLES
  • EXAMPLE 1
  • EXAMPLE 2
  • EXAMPLE 3
  • EXAMPLE 4
  • EXAMPLE 5
  • EXAMPLE 6
  • EXAMPLE 7
  • EXAMPLE 8
  • PARAMETERS
  • -Body
  • -ReturnJSON
  • -ReturnNode
  • -Server
  • -api
  • CommonParameters
  • INPUTS
  • OUTPUTS
  • NOTES
  • RELATED LINKS

Was this helpful?

  1. Command Documentation
  2. Reference

Invoke-RubrikGraphQLCall

SYNOPSIS

Provides generic interface to make Rubrik GraphQL API calls

SYNTAX

Default

Invoke-RubrikGraphQLCall -Body <String> [-Server <String>] [-api <String>] [<CommonParameters>]

Node

Invoke-RubrikGraphQLCall -Body <String> [-ReturnNode] [-Server <String>] [-api <String>] [<CommonParameters>]

JSON

Invoke-RubrikGraphQLCall -Body <String> [-ReturnJSON] [-Server <String>] [-api <String>] [<CommonParameters>]

DESCRIPTION

The Invoke-RubrikGraphQLCall allows users to make raw API endpoint calls to the Rubrik GraphQL interface. To find out more about the GraphQL endpoint take a look at the Rubrik GraphQL Playground project that is hosted on GitHub: https://github.com/rubrikinc/graphql-playground

EXAMPLES

EXAMPLE 1

Invoke-RubrikGraphQLCall -Body '{"query":"{vmwareVcenterTotalCount}"}' -Verbose

Will retrieve the total count of VMware vCenter Servers connected to the Rubrik cluster as a PowerShell object

EXAMPLE 2

Invoke-RubrikGraphQLCall -ReturnJSON -Body '{"query":"query{vms {\nnumProtected\n  numUnprotected\n}}"}'

Returns the number of protected and unprotected VMware VM objects as a JSON string

EXAMPLE 3

Invoke-RubrikGraphQLCall -ReturnJSON -Verbose -Body '{"query":"query{\r\n  vmwareVirtualMachineConnection(name: \"jbrasser-win\", primaryClusterId: \"local\") {\nedges {\n  node {\n name,\n id,\n primaryClusterId,\n configuredSlaDomainId\n  }\n}\r\n  }\r\n}"}'

Returns the 'jbrasser-win' VM on the local Rubrik cluster as a JSON string, while displaying Verbose information

EXAMPLE 4

Invoke-RubrikGraphQLCall -ReturnNode -Body '{"query":"query ( $name: String) {\nvmwareVirtualMachineConnection(name: $name, primaryClusterId: \"local\") {\n  edges {\nnode {\n  name,\n  id,\n  primaryClusterId,\n  configuredSlaDomainId\n}\n  }\n}\r\n}","variables":{"name":"jbrasser-lin"}}'

Returns the 'jbrasser-lin' VM on the local Rubrik cluster as the VM Object, using a variable as input for vmwareVirtualMachineConnection

EXAMPLE 5

Invoke-RubrikGraphQLCall -ReturnNode -Body '{"query":"query{\r\n  vmwareVirtualMachineConnection{\nedges {\n  node {\nhostId\neffectiveSlaDomain {\nid\nname\n}\nprimaryClusterId\nconfiguredSlaDomainId\nid\nvmwareToolsInstalled\nisRelic\nname\nvcenterId\nfolderPath {\nid\nname\n}\ninfraPath {\nid\nname\n}\nagentStatus {\nagentStatus\ndisconnectReason\n}\nhostName\nclusterName\n  }\n}\r\n  }\r\n}","variables":{}}'

Returns all VMware VMs on the Rubrik Cluster and displays the individual objects by using the -ReturnNode parameter

EXAMPLE 6

Invoke-RubrikGraphQLCall -ReturnNode -Body '{"query":"query OrganizationSummary(\n $name: String,\n $isGlobal: Boolean,\n $sortBy: String,\n $sortOrder: String,\n $first: Int,\n $after: String,\n) {\n organizationConnection(\n name: $name,\n isGlobal: $isGlobal,\n sortBy: $sortBy,\n sortOrder: $sortOrder,\n first: $first,\n after: $after\n ) {\n nodes {\n id\n name\n isGlobal\n exclusivenessLevel\n admins {\n id\n name\n }\n envoyStatus\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n","variables":{"sortBy":"name","sortOrder":"asc","first":3,"name":"org","isGlobal":false}}'

Returns informations on Rubrik Organizations, filtered by name in ascending order and only including organizations with 'org' in their name property. Returns the individual organization objects using the -ReturnNode parameter

EXAMPLE 7

(Invoke-RubrikGraphQLCall -Body '{"query":"query HostsWithSnappables(\n  $effectiveSlaDomainId: String,\n  $hostname: String,\n  $operatingSystemType: String,\n  $status: String,\n  $primaryClusterId: String,\n  $sortBy: String,\n  $sortOrder: String,\n  $templateId: String,\n  $snappableStatus: String,\n  $first: Int,\n  $after: String,\n) {\n    hostConnection(\n        effectiveSlaDomainId:  $effectiveSlaDomainId,\n        hostname: $hostname,\n        operatingSystemType: $operatingSystemType,\n        status: $status,\n        primaryClusterId: $primaryClusterId,\n        sortBy: $sortBy,\n        sortOrder: $sortOrder,\n        templateId: $templateId,\n        snappableStatus: $snappableStatus,\n        first: $first,\n        after: $after,\n    )\n    {\n        nodes {\n            id\n            hostname\n            primaryClusterId\n            operatingSystem\n            operatingSystemType\n            status\n            filesets\n            {\n                hostName\n                operatingSystemType\n                excludes\n                configuredSlaDomainName\n                effectiveSlaDomainId\n                isEffectiveSlaDomainRetentionLocked\n                primaryClusterId\n                hostId\n                includes\n                configuredSlaDomainId\n                configuredSlaDomainType\n                templateId\n                allowBackupNetworkMounts\n                exceptions\n                effectiveSlaDomainName\n                allowBackupHiddenFoldersInNetworkMounts\n                templateName\n                useWindowsVss\n                isRelic\n                name\n                id\n                isPassthrough\n                enableSymlinkResolution\n                enableHardlinkSupport\n                pendingSlaDomain {\n                  objectId,\n                  pendingSlaDomainId,\n                  pendingSlaDomainName,\n                  isPendingSlaDomainRetentionLocked\n                }\n            }\n            hostVfdDriverState\n            volumeGroup\n            {\n                isPaused\n                configuredSlaDomainName\n                effectiveSlaDomainId\n                isEffectiveSlaDomainRetentionLocked\n                primaryClusterId\n                slaAssignment\n                effectiveSlaSourceObjectId\n                volumes {\n                    mountPoints\n                    isCurrentlyPresentOnSystem\n                    id\n                    size\n                    includeInSnapshots\n                    fileSystemType\n                }\n                effectiveSlaSourceObjectName\n                hostId\n                configuredSlaDomainId\n                configuredSlaDomainType\n                effectiveSlaDomainName\n                hostname\n                isRelic\n                name\n                volumeIdsIncludedInSnapshots\n                id\n            }\n            storageArrayVolumeGroups\n            {\n                id\n                name\n                storageArrayId\n                storageArrayName\n                storageArrayType\n                hostId\n                hostname\n                proxyHostId\n                proxyHostname\n                volumes {\n                    id\n                    serial\n                    name\n                    storageArrayId\n                    storageArrayType\n                }\n                configuredSlaDomainId\n                configuredSlaDomainType\n                configuredSlaDomainName\n                effectiveSlaDomainId\n                isEffectiveSlaDomainRetentionLocked\n                effectiveSlaDomainName\n                slaAssignment\n                primaryClusterId\n            }\n        },\n        pageInfo {\n          endCursor\n          hasNextPage\n        }\n    }\n}\n","variables":{"first":50,"operatingSystemType":"Windows","primaryClusterId":"local","sortBy":"hostname","sortOrder":"asc","snappableStatus":"Protectable"}}').hostconnection.nodes | % {[pscustomobject]@{hostname=$_.Hostname;volumegroup=$_.volumegroup.name;volumegroupsla=$_.volumegroup.effectivesladomainname}}

Queries all hosts with volumegroups for the SLA set on that specific volumegroup. Returns 3 properties: hostname, volumegroup, volumegroupsla

EXAMPLE 8

Invoke-RubrikGraphQLCall -Body '{"query":"fragment counts on GraphQlProtectedObjectCount {\n    numProtected\n    numUnprotected\n    numNoSla\n    numDoNotProtect\n}\nquery TallyCounts {\n    vms { ...counts },\n    vcdVapps { ...counts },\n    mssqlDbs { ...counts },\n    linuxHosts { ...counts },\n    windowHosts { ...counts },\n    nasShares { ...counts },\n    hypervVms { ...counts },\n    cloudNativeVms { ...counts }\n    managedVolumes {...counts},\n    nutanixVms { ...counts },\n    oracleDbs { ...counts }\n}\n","variables":{}}'

Gives a count of Protected, Unprotected, NoSla & DoNotProtect for cloudNativeVms, hypervVms, linuxHosts, managedVolumes, mssqlDbs, nasShares, nutanixVms, oracleDbs, vcdVapps, vms, windowHosts

PARAMETERS

-Body

GraphQL Body to send to GraphQL endpoint

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ReturnJSON

Return the JSON object instead of converting it to PowerShell custom objects

Type: SwitchParameter
Parameter Sets: JSON
Aliases:

Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-ReturnNode

Return the objects in the Node(s) property rather than returning the output as a single custom Object

Type: SwitchParameter
Parameter Sets: Node
Aliases:

Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Server

Rubrik server IP or FQDN

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: $global:RubrikConnection.server
Accept pipeline input: False
Accept wildcard characters: False

-api

API version

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: $global:RubrikConnection.api
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

INPUTS

OUTPUTS

NOTES

Written by Jaap Brasser for community usage Twitter: @jaap_brasser GitHub: jaapbrasser

RELATED LINKS

PreviousGet-RubrikVolumeGroupMountNextInvoke-RubrikHvmFormatUpgrade

Last updated 3 years ago

Was this helpful?

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see .

about_CommonParameters
https://rubrik.gitbook.io/rubrik-sdk-for-powershell/command-documentation/reference/invoke-rubrikgraphqlcall