# rubrik\_on\_demand\_snapshot

## rubrik\_on\_demand\_snapshot

Take an on-demand snapshot of a Rubrik object.

`Requirement: Rubrik Python SDK (pip install rubrik_cdm)`

## Example

```yaml
- rubrik_on_demand_snapshot:
    object_name: 'ansible-node01'
    object_type: "VMware"

- rubrik_on_demand_snapshot:
    object_name: "ansible-demo"
    object_type: "physical_host"
    fileset: "Python SDK"
    host_os: "Linux"
```

## Arugments

### Common

| Name       | Description                                                                                                                                                                                                                                                                                                  | Default |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------- |
| node\_ip   | The DNS hostname or IP address of the Rubrik cluster. By defeault, the module will attempt to read this value from the rubrik\_cdm\_node\_ip environment variable. If this environment variable is not present it will need to be manually specified here or in the \`provider' parameter.                   |         |
| password   | The password used to authenticate the connection to the Rubrik cluster. By defeault, the module will attempt to read this value from the rubrik\_cdm\_password environment variable. If this environment variable is not present it will need to be manually specified here or in the \`provider' parameter. |         |
| username   | The username used to authenticate the connection to the Rubrik cluster. By defeault, the module will attempt to read this value from the rubrik\_cdm\_username environment variable. If this environment variable is not present it will need to be manually specified here or in the \`provider' parameter. |         |
| api\_token | The api token used to authenticate the connection to the Rubrik cluster. By defeault, the module will attempt to read this value from the rubrik\_cdm\_token environment variable. If this environment variable is not present it will need to be manually specified here or in the \`provider' parameter.   |         |
| provider   | Convenience method that allows all connection arguments (`node_ip',`username', \`password') to be passed as a dict object. By default, the module will attempt to read these parameters from the rubrik\_cdm\_node\_ip, rubrik\_cdm\_username, and rubrik\_cdm\_password environment variables.              |         |

| Note: The `username` and `password` must be supplied together and may not be provided if the `api_token` variable is present |
| ---------------------------------------------------------------------------------------------------------------------------- |

### Module Specific

| Name          | Description                                                                                                                   | Default | Type   | Choices                                | Mandatory | Aliases |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------- | ------- | ------ | -------------------------------------- | --------- | ------- |
| fileset       | The name of the Fileset you wish to backup. Only required when taking a on-demand snapshot of a physical host.                | None    | string |                                        |           |         |
| host\_os      | The operating system for the physical host. Only required when taking a on-demand snapshot of a physical host.                | None    | string | None, Linux, Windows                   |           |         |
| object\_name  | The name of the Rubrik object to take a on-demand snapshot of.                                                                |         | string |                                        | true      |         |
| object\_type  | The Rubrik object type you want to backup.                                                                                    | VMware  |        | VMware, physical\_host, ahv, mssql\_db |           |         |
| sla\_name     | The SLA Domain name you want to assign the on-demand snapshot to. By default, the currently assigned SLA Domain will be used. | current |        |                                        |           |         |
| sql\_host     | The name of the SQL Host hosting the specified database. Only required when taking a on-demand snapshot of a MSSQL DB.        | None    | string |                                        |           |         |
| sql\_instance | The name of the SQL Instance hosting the specified database. Only required when taking a on-demand snapshot of a MSSQL DB.    | None    | string |                                        |           |         |
| timeout       | The number of seconds to wait to establish a connection the Rubrik cluster before returning a timeout error.                  | 30      | int    |                                        |           |         |

## Return Values

| Name             | Description                                                                                                                  | Returned                                       | Type   |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ------ |
| response         | The full API response for POST /v1/VMware/vm/{id}/snapshot.                                                                  | on success when action is VMware               | dict   |
| response         | The full API response for POST /v1/fileset/{id}/snapshot.                                                                    | on success when object\_type is physical\_host | dict   |
| job\_status\_url | The job staturs url retuend by the full API response which can be passed into the rubrik\_job\_status module for monitoring. | success                                        | string |
