### Setup Mock API Server and Environment Variable Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/Tests/mock/README.md Use BeforeAll to start the mock API server and set the service account file path environment variable. ```powershell BeforeAll { Start-MockApiServer $env:RSC_SERVICE_ACCOUNT_FILE = "mock/mock_service_account.json" } ``` -------------------------------- ### New-RscMutationAzure -Operation StartAdAppSetup Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/domains_and_operations.md This mutation starts the setup process for an Azure AD app. It can be invoked using the New-RscMutationAzure cmdlet with the StartAdAppSetup operation. ```APIDOC ## New-RscMutationAzure -Operation StartAdAppSetup ### Description Starts the setup process for an Azure AD app. ### Method POST ### Endpoint /graphql ### Parameters #### Query Parameters - **Gql** (string) - Required - `startAzureAdAppSetup` ### Request Example ```json { "query": "mutation startAzureAdAppSetup { startAzureAdAppSetup { id } }" } ``` ### Response #### Success Response (200) - **id** (string) - The ID of the operation. ``` -------------------------------- ### Quick Start Examples for Get-RscHelp Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/get_rschelp.md Demonstrates various ways to use Get-RscHelp for quick schema lookups, including keyword searches, specific query/mutation lookups, type field inspection, and schema statistics. ```powershell # Search by keyword (across all schema elements) Get-RscHelp cluster* ``` ```powershell # Look up a specific query Get-RscHelp -Query clusterConnection ``` ```powershell # Look up a specific mutation Get-RscHelp -Mutation createGlobalSla ``` ```powershell # Inspect a type's fields Get-RscHelp Cluster.Name ``` ```powershell Get-RscHelp Cluster. # all fields on the Cluster type ``` ```powershell # Schema statistics Get-RscHelp -Stats ``` -------------------------------- ### Write Unit Test for Cmdlet Help Synopsis and Description Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/Toolkit/Docs/TOOLKIT_DEVELOPER_MANUAL.md Example of a unit test for the Get-RscStuff cmdlet, ensuring its Synopsis and Description help information are not empty. It uses BeforeAll for setup and Describe/It blocks for testing. ```powershell <# .SYNOPSIS Basic tests for Get-RscStuff #> BeforeAll { . "$PSScriptRoot\..\UnitTestInit.ps1" # variables shared among tests $Global:data = @{ } } Describe -Name "Get-RscStuff Tests" -Fixture { It -Name "checks help is not empty" -Test { $help = Get-Help Get-RscStuff $help.Synopsis | Should -Not -BeNullOrEmpty $help.Description | Should -Not -BeNullOrEmpty } } ``` -------------------------------- ### Install RubrikSecurityCloud Module and Set Service Account Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/Samples/README.md Installs the RubrikSecurityCloud PowerShell module and sets up the service account file for authentication. This is a one-time setup. ```powershell Install-Module RubrikSecurityCloud Set-RscServiceAccountFile /path/to/service_account.json # one-time setup ``` -------------------------------- ### Install RubrikSecurityCloud from Source Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/README.md For advanced users, install the SDK from local source code after cloning the repository. This allows for viewing and contributing to the SDK's source. ```shell git clone git@github.com:rubrikinc/rubrik-powershell-sdk.git cd rubrik-powershell-sdk ``` ```powershell ./Utils/Import-RscModuleFromLocalOutputDir.ps1 ``` -------------------------------- ### Input Object Example (v0.11-beta) Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/CHANGELOG.md Provides an example of using an input object retrieved with '-GetInput' for subsequent cmdlet execution, demonstrating the pattern '$i = (Cmdlet -GetInput); ...; Cmdlet -Input $i'. ```powershell $i=(Invoke-RscXxx -GetInput); ...; Invoke-RscXxx -Input $i ``` -------------------------------- ### Exocompute Network Setup Template Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/domains_and_operations.md Retrieves the Exocompute network setup template for Azure. This can be invoked using the New-RscQueryAzure cmdlet with the ExocomputeNetworkSetupTemplate operation or the New-RscQuery cmdlet with the azureExocomputeNetworkSetupTemplate GraphQL query. ```APIDOC ## New-RscQueryAzure -Operation ExocomputeNetworkSetupTemplate ### Description Retrieves the Exocompute network setup template for Azure. ### Method POST ### Endpoint /graphql ### Parameters #### Query Parameters - **operation** (string) - Required - The operation to perform, which is 'ExocomputeNetworkSetupTemplate'. ### Request Example ```json { "query": "query { azureExocomputeNetworkSetupTemplate { ... } }" } ``` ### Response #### Success Response (200) - **data** (object) - Contains the result of the query. - **azureExocomputeNetworkSetupTemplate** (object) - The Exocompute network setup template. - **templateName** (string) - The name of the network setup template. - **description** (string) - A description of the template. #### Response Example ```json { "data": { "azureExocomputeNetworkSetupTemplate": { "templateName": "DefaultNetworkTemplate", "description": "Standard network configuration for Exocompute." } } } ``` ``` -------------------------------- ### startadappsetup Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/cmdlets/New-RscMutationAzure.md Initiates the Azure AD app creation workflow. It takes a single input argument and returns a reply. ```APIDOC ## startadappsetup ### Description Initiates the Azure AD app creation workflow. ### Parameters #### Request Body - **input** (StartAzureAdAppSetupInput) - Required - The input object for the operation. ### Response #### Success Response - **reply** (StartAzureAdAppSetupReply) - The reply object containing the result of the app setup. ``` -------------------------------- ### setupsqlserverbackup Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/cmdlets/New-RscMutationCloudNative.md Setup backups on the SQL Server databases using the admin credentials. ```APIDOC ## setupsqlserverbackup ### Description Setup backups on the SQL Server databases using the admin credentials. ### Parameters #### Request Body - **Input** (SetupCloudNativeSqlServerBackupInput) - Required - The input object for setting up SQL Server backups. ### Response #### Success Response - **Reply** (BatchAsyncJobStatus) - The status of the asynchronous backup setup job. ``` -------------------------------- ### setupexocompute Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/cmdlets/New-RscMutationAzureO365.md Sets up Exocompute for an O365 subscription using the `setupexocompute` subcommand of `New-RscMutationAzureO365`. ```APIDOC ## New-RscMutationAzureO365 setupexocompute ### Description Sets up Exocompute for an O365 subscription. ### Method Not Applicable (PowerShell Cmdlet) ### Endpoint Not Applicable (PowerShell Cmdlet) ### Parameters #### Path Parameters None #### Query Parameters None #### Cmdlet Parameters - **tenantId** (System.String) - Required - The ID of the tenant. - **subscriptionId** (System.String) - Required - The ID of the subscription. - **exocomputeConfig** (AzureO365ExocomputeConfig) - Required - Configuration for Exocompute. ### Request Example ```powershell New-RscMutationAzureO365 -tenantId "your-tenant-id" -subscriptionId "your-subscription-id" -exocomputeConfig $exocomputeConfig ``` ### Response #### Success Response - Returns SetupAzureO365ExocomputeResp. #### Response Example ```json { "example": "SetupAzureO365ExocomputeResp object" } ``` ``` -------------------------------- ### Get CDM Upgrade Info Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/HOWTO_create_a_query.md Example query to retrieve CDM upgrade information for the first cluster. It shows how to add specific complex fields and process the results. ```powershell $result = New-RscQuery -Gql clusterConnection ` -Var @{ first = 1 } ` -AddField Nodes.CdmUpgradeInfo | ` Invoke-Rsc ``` ```powershell $result.Nodes[0].CdmUpgradeInfo | Remove-NullProperties ``` -------------------------------- ### setupdisk Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/cmdlets/New-RscMutationMisc.md Sets up an unformatted disk. This cmdlet takes a single argument of type SetupDiskInput and returns DiskInfo. ```APIDOC ## setupdisk ### Description Setup an unformatted disk. ### Parameters #### Request Body - **input** (SetupDiskInput) - Required - The input object for the setup disk operation. ### Response #### Success Response (200) - **DiskInfo** - Information about the setup disk. ``` -------------------------------- ### startdownloadpackagebatchjob Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/cmdlets/New-RscMutationMisc.md Starts a CDM job to download an installer package in batch. This cmdlet supports specifying a list of cluster UUIDs, download version, package URL, MD5 checksum, and package size. ```APIDOC ## startdownloadpackagebatchjob ### Description Starts a CDM job to download an installer package in batch. ### Method POST ### Endpoint /api/v1/cdm/download/package/batch/job ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **listClusterUuid** (list of System.String) - Required - Specifies the list of cluster UUIDs. - **downloadVersion** (System.String) - Required - Specifies the Rubrik CDM download package version. - **packageUrl** (System.String) - Required - Specifies the Rubrik CDM upgrade package URL. - **md5checksum** (System.String) - Required - Specifies the MD5CheckSum of the Rubrik CDM installer package. - **size** (System.Int64) - Required - Specifies the size in bytes of the Rubrik CDM package. ### Request Example ```json { "listClusterUuid": ["uuid1", "uuid2"], "downloadVersion": "1.0.0", "packageUrl": "http://example.com/package.tar.gz", "md5checksum": "d41d8cd98f00b204e9800998ecf8427e", "size": 1024000 } ``` ### Response #### Success Response (200) - **downloadPackageReplyWithUuids** (list of DownloadPackageReplyWithUuids) - A list of objects containing information about the download package job. #### Response Example ```json { "downloadPackageReplyWithUuids": [ { "uuid": "job-uuid-1", "status": "Queued" } ] } ``` ``` -------------------------------- ### setupkickoff Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/cmdlets/New-RscMutationO365.md Kicks off an O365 subscription setup flow. This cmdlet takes no arguments and returns O365SetupKickoffResp. ```APIDOC ## setupkickoff ### Description Kicks off an O365 subscription setup flow. ### Method N/A (PowerShell Cmdlet) ### Endpoint N/A (PowerShell Cmdlet) ### Parameters This cmdlet takes no arguments. ### Response #### Success Response - O365SetupKickoffResp ``` -------------------------------- ### New-RscMutationFileset generatebackupreport Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/cmdlets/New-RscMutationFileset.md Generates a success and failure report for a fileset backup. Supported in v9.2+. Starts an asynchronous job to generate files for a specified fileset backup. The response returns an asynchronous request ID. To get the URL for downloading the ZIP file, send a GET request to 'fileset/request/{id}'. It accepts a single argument of type GenerateFilesetBackupReportInput and returns an AsyncRequestStatus. ```APIDOC ## New-RscMutationFileset generatebackupreport ### Description Generates a success and failure report for a fileset backup. Starts an asynchronous job to generate files for a specified fileset backup. ### Supported Versions v9.2+ ### Method POST ### Endpoint /api/v1/fileset/generate_backup_report ### Parameters #### Request Body - **input** (GenerateFilesetBackupReportInput) - Required - The input object for generating a fileset backup report. ### Response #### Success Response (200) - **id** (string) - The asynchronous request ID. ``` -------------------------------- ### completeAzureAdAppSetup Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/domains_and_operations.md Completes the setup for an Azure AD application. This is the recommended mutation. ```APIDOC ## completeAzureAdAppSetup ### Description Completes the setup for an Azure AD application. This is the recommended mutation. ### Method `New-RscMutation -Gql completeAzureAdAppSetup` ### Endpoint [completeAzureAdAppSetup](https://rubrikinc.github.io/rubrik-api-documentation/schema/reference/query.doc.html) ### Parameters This operation does not explicitly list parameters in the source. Refer to the GraphQL schema for details. ### Request Example ```powershell New-RscMutation -Gql completeAzureAdAppSetup -Parameters @{ ... } ``` ### Response Refer to the GraphQL schema for response details. ``` -------------------------------- ### Creating a Query for Patch Testing Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/autofield.md This example demonstrates the initial steps for creating a new patch file: first, create a query and inspect its fields, then test manual field additions. ```powershell $q = New-RscQuery -Gql mssqlDatabaseLiveMounts $q.GqlRequest().Query ``` ```powershell $q2 = New-RscQuery -Copy $q -AddField Nodes.creationDate $q2.GqlRequest().Query # verify the field appears ``` -------------------------------- ### Select Multiple Specific Types with InitialProperties Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/design_initialproperties_type_selector.md Combine multiple 'on:' selectors to retrieve properties from different specific types within the same List field. For example, get 'id' for 'PhysicalHost' and 'name' for 'MssqlDatabase'. ```powershell Get-RscType -Name MssqlTopLevelDescendantTypeConnection \ -InitialProperties nodes.on:PhysicalHost.id,nodes.on:MssqlDatabase.name ``` -------------------------------- ### Install RubrikSecurityCloud Module Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/Toolkit/Docs/TOOLKIT_DEVELOPER_MANUAL.md Installs the Rubrik Security Cloud PowerShell module. This is the primary end-user installation command. ```powershell Install-Module -Name RubrikSecurityCloud ``` -------------------------------- ### StartAzureAdAppSetupReply Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/outputs/StartAzureAdAppSetupReply.md The response object returned after initiating the Azure AD application setup process. It contains information about the created app, security tokens, and any encountered warnings or permission discrepancies. ```APIDOC ## StartAzureAdAppSetupReply ### Description This object represents the reply from the operation that initiates the onboarding of an Azure AD application. It provides details necessary for subsequent setup steps and highlights any potential issues. ### Properties - **csrfToken** (System.String) - Required - State token to be used in `CompleteAzureAdAppSetupReply`. - **appId** (System.String) - Required - ID of the created Azure AD app. - **warning** (AzureAdAppSetupWarningType) - Optional - A warning message indicating a unrecommended onboarding scenario. - **tenantCloudType** (AzureCloudType) - Optional - Cloud type of the Entra ID tenant. - **missingPermissions** (list of System.Strings) - Optional - List of missing permissions for the Entra ID app. - **excessivePermissions** (list of System.Strings) - Optional - List of excessive permissions for the Entra ID app. ``` -------------------------------- ### installiofilter Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/cmdlets/New-RscMutationMisc.md Installs the Rubrik ioFilter to a VMware cluster. Supported in v5.1+. The cluster must be in maintenance mode, and its vCenter version must be 6.7 or above for successful installation. ```APIDOC ## installiofilter ### Description Install the Rubrik ioFilter to the VMware cluster with a specific ID. Supported in v5.1+. Install the latest version of Rubrik ioFilter to the VMware cluster with a specific ID. The cluster must be in maintenance mode to install the ioFilter successfully. The vCenter of the VMware compute cluster must be of version 6.7 and above. ### Parameters #### Request Body - **InstallIoFilterInput** (object) - Required - Input object for installing the ioFilter. ### Response #### Success Response - **RequestSuccess** (object) - Indicates that the request was successful. ``` -------------------------------- ### completeadappsetup Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/cmdlets/New-RscMutationAzure.md Completes the creation flow for an Azure AD app. ```APIDOC ## completeadappsetup ### Description Completes the creation flow for an Azure AD app. ### Parameters #### Request Body - **input** (CompleteAzureAdAppSetupInput) - Required - The input object for completing Azure AD app setup. ### Response #### Success Response - Returns CompleteAzureAdAppSetupReply. ``` -------------------------------- ### checkcloudcomputeconnectivityjobprogress Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/cmdlets/New-RscQueryMisc.md Get details of the cloud compute connectivity check request. Supported in v6.0+. Gets the details of the request that was triggered to check the cloud compute connectivity of an archival location. ```APIDOC ## checkcloudcomputeconnectivityjobprogress ### Description Get details of the cloud compute connectivity check request. Supported in v6.0+. Gets the details of the request that was triggered to check the cloud compute connectivity of an archival location. ### Method Invoke-RscQuery ### Endpoint N/A (PowerShell cmdlet) ### Parameters #### Path Parameters None #### Query Parameters None #### Cmdlet Parameters - **input** (GetCloudComputeConnectivityCheckRequestStatusInput) - Required - The input object for retrieving the status of the cloud compute connectivity check. ### Request Example ```powershell $request = New-Object RubrikSecurityCloud.Types.GetCloudComputeConnectivityCheckRequestStatusInput # Set properties of $request as needed Invoke-RscQuery -Command "checkcloudcomputeconnectivityjobprogress" -Parameters @{ "input" = $request } ``` ### Response #### Success Response - Returns AsyncRequestStatus. ``` -------------------------------- ### saassetupkickoff Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/cmdlets/New-RscMutationO365.md Initiates the Rubrik-Hosted setup flow. This subcommand takes no arguments and returns an O365SaasSetupKickoffReply. ```APIDOC ## saassetupkickoff ### Description Initiates the Rubrik-Hosted setup flow. ### Parameters No parameters are required for this command. ### Response #### Success Response (200) - **response** (O365SaasSetupKickoffReply) - The reply object after initiating the setup. ``` -------------------------------- ### Get RSC Help for a Specific Cmdlet Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/get_rschelp.md Use the -Cmdlet parameter to get detailed help for a specific cmdlet, similar to Get-Help -Full. This is particularly useful for wrapper cmdlets. ```powershell Get-RscHelp -Cmdlet Get-RscCluster ``` -------------------------------- ### startcreatevirtualmachinesnapshotsjob Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/cmdlets/New-RscMutationAzureNative.md Start a job to create a snapshot for the Azure Native virtual machine identified by the IDs. ```APIDOC ## startcreatevirtualmachinesnapshotsjob ### Description Start a job to create a snapshot for the Azure Native virtual machine identified by the IDs. When started, this will start taking an on-demand snapshot of the selected VMs as per the SLA Policy assigned to the respective VMs. ### Parameters #### Request Body - **input** (StartCreateAzureNativeVirtualMachineSnapshotsJobInput) - Required - The input object for starting the snapshot job. ### Response #### Success Response (200) - **result** (BatchAsyncJobStatus) - An object containing the status of the asynchronous job. ``` -------------------------------- ### Start Exocompute Disable Job Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/domains_and_operations.md Starts a job to disable Exocompute for AWS. This operation is invoked using the `New-RscMutationAws` cmdlet with the `StartExocomputeDisableJob` operation or directly via the `startAwsExocomputeDisableJob` GraphQL mutation. ```APIDOC ## New-RscMutationAws -Operation StartExocomputeDisableJob ### Description Starts a job to disable Exocompute for AWS. ### Method POST ### Endpoint /graphql ### Parameters #### Query Parameters - **operation** (string) - Required - The mutation operation to perform. ### Request Body - **query** (string) - Required - The GraphQL mutation query. ### Request Example ```json { "query": "mutation { startAwsExocomputeDisableJob }" } ``` ### Response #### Success Response (200) - **data** (object) - The result of the mutation. #### Response Example ```json { "data": { "startAwsExocomputeDisableJob": { "success": true } } } ``` ``` -------------------------------- ### saassetupcomplete Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/cmdlets/New-RscMutationO365.md Completes a Rubrik-Hosted setup flow. It takes a single argument of type O365SaasSetupCompleteInput and returns an AddO365OrgResponse. ```APIDOC ## saassetupcomplete ### Description Completes a Rubrik-Hosted setup flow. ### Parameters #### Request Body - **input** (O365SaasSetupCompleteInput) - Required - The input object for completing the Rubrik-Hosted setup. ### Response #### Success Response (200) - **response** (AddO365OrgResponse) - The response object after completing the setup. ``` -------------------------------- ### startrdsinstancesnapshotsjob Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/cmdlets/New-RscMutationAwsNative.md Starts a job to create snapshots of RDS Instances with given IDs. When completed, this will start taking an on-demand snapshot of the selected RDS Instances as per the SLA Policy assigned to the respective instances. ```APIDOC ## startrdsinstancesnapshotsjob ### Description Starts a job to create snapshots of RDS Instances with given IDs. When completed, this will start taking an on-demand snapshot of the selected RDS Instances as per the SLA Policy assigned to the respective instances. ### Parameters #### Request Body - **StartAwsNativeRdsInstanceSnapshotsJobInput** (object) - Required - Input object for starting the RDS instance snapshot creation job. ### Response #### Success Response (200) - **BatchAsyncJobStatus** - An object containing the status of the batch asynchronous job. ``` -------------------------------- ### startec2instancesnapshotsjob Source: https://github.com/rubrikinc/rubrik-powershell-sdk/blob/main/docs/powershell/cmdlets/New-RscMutationAwsNative.md Starts an on-demand create snapshot job for AWS EC2 Instances. When completed, this will start taking an on-demand snapshot of the selected EC2 Instances as per the SLA Policy assigned to the respective instances. ```APIDOC ## startec2instancesnapshotsjob ### Description Starts an on-demand create snapshot job for AWS EC2 Instances. When completed, this will start taking an on-demand snapshot of the selected EC2 Instances as per the SLA Policy assigned to the respective instances. ### Parameters #### Request Body - **StartAwsNativeEc2InstanceSnapshotsJobInput** (object) - Required - Input object for starting the EC2 instance snapshot creation job. ### Response #### Success Response (200) - **BatchAsyncJobStatus** - An object containing the status of the batch asynchronous job. ```