rubrik_polaris.accounts package¶
Submodules¶
rubrik_polaris.accounts.aws module¶
-
rubrik_polaris.accounts.aws.
add_account_aws
(self, aws_regions=[], all=False, aws_profiles=[], aws_access_key_id=None, aws_secret_access_key=None, cloud_account_features=None)¶ Add AWS account to Polaris
- Parameters
aws_regions (list) – List of AWS regions to include in Polaris for imported accounts
aws_profiles (list) – Optional list of local profile names to add to Polaris
all (bool) – Optional set true to import all locally configured profiles to Polaris
aws_access_key_id (str) – AWS Access key of account to import to Polaris
aws_secret_access_key (str) – AWS secret of key of account to import to polaris
cloud_account_features (list) – List of services to enable for cloud account
- Returns
Status if unsuccessful
- Return type
dict
- Raises
RequestException – If the query to Polaris returned an error
Examples
>>> rubrik.add_account_aws(aws_regions = ["us-east-1"], aws_profiles = ["milanese"], cloud_account_features = ["CLOUD_NATIVE_PROTECTION"]) >>> rubrik.add_account_aws(aws_regions = ["us-east-1"], aws_access_key_id='blah', aws_secret_access_key='blah', cloud_account_features = ["CLOUD_NATIVE_PROTECTION"]) >>> rubrik.add_account_aws(aws_regions = ["us-west-2"], all = True , cloud_account_features = ["CLOUD_NATIVE_PROTECTION"])
-
rubrik_polaris.accounts.aws.
get_accounts_aws
(self, filter='')¶ Retrieves AWS account information from Polaris
- Parameters
filter (str) – Search string to filter results
- Returns
Details of AWS accounts in Polaris
- Return type
dict
- Raises
RequestException – If the query to Polaris returned an error
-
rubrik_polaris.accounts.aws.
get_accounts_aws_detail
(self, filter)¶ Retrieves deployment details for AWS from Polaris
- Parameters
filter (str) – Search string to filter results
- Returns
Details of Azure accounts in Polaris
- Return type
dict
- Raises
RequestException – If the query to Polaris returned an error
-
rubrik_polaris.accounts.aws.
get_account_aws_native_id
(self, profile='', aws_id=None, aws_secret=None)¶ Retrieves AWS Account ID from local config
- Parameters
profile (str) – Profile name of local configuration
aws_access_key_id (str) – AWS Access key to import to Polaris
aws_secret_access_key (str) – AWS secret of key to import to polaris
- Returns
AWS account name and ID of requested account
- Return type
list
- Raises
RequestException – If the query to Polaris returned an error
-
rubrik_polaris.accounts.aws.
delete_account_aws
(self, profiles=[], all=False, aws_access_key_id=None, aws_secret_access_key=None)¶ Remove AWS account from Polaris
- Parameters
profiles (list) – Optional list of local profile names to remove from Polaris
all (bool) – Optional set true to remove all locally configured profiles from Polaris
aws_access_key_id (str) – AWS Access key to import to Polaris
aws_secret_access_key (str) – AWS secret of key to import to polaris
- Returns
Status if unsuccessful
- Return type
dict
- Raises
RequestException – If the query to Polaris returned an error
Examples
>>> rubrik.delete_account_aws(profiles = ['milanese_profile']) >>> rubrik.delete_account_aws(aws_access_key_id='blah', aws_secret_access_key='blah') >>> rubrik.delete_account_aws(all = True )
-
rubrik_polaris.accounts.aws.
update_account_aws
(self, regions=[], all=False, profiles=[], aws_access_key_id=None, aws_secret_access_key=None)¶ Updates AWS account if configured in Polaris (Under Development)
rubrik_polaris.accounts.azure module¶
-
rubrik_polaris.accounts.azure.
get_accounts_azure_native
(self, filter='')¶ Retrieves Azure native account information from Polaris
- Parameters
filter (str) – Search string to filter results
- Returns
Details of Azure native accounts in Polaris
- Return type
dict
- Raises
RequestException – If the query to Polaris returned an error
-
rubrik_polaris.accounts.azure.
get_accounts_azure_cloud
(self, cloud_account_features='CLOUD_NATIVE_PROTECTION')¶ Retrieves Azure cloud account information from Polaris
- Parameters
cloud_account_features (str) – Feature string to filter results
- Returns
Details of Azure cloud accounts in Polaris
- Return type
dict
- Raises
RequestException – If the query to Polaris returned an error
-
rubrik_polaris.accounts.azure.
set_account_azure_default_sa
(self, azure_app_id=None, azure_app_secret_key=None, azure_app_tenant_id=None, azure_app_name=None, azure_tenant_domain_name=None, azure_cloud_type='AZUREPUBLICCLOUD', should_replace=False)¶ Set default SA for Azure :param azure_app_id: Client ID of the Application :type azure_app_id: str :param azure_app_secret_key: Client secret key of the Application. :type azure_app_secret_key: str :param azure_app_tenant_id: Optional, ID of the home tenant of the application. :type azure_app_tenant_id: str :param azure_app_name: Optional, Name of the application :type azure_app_name: str :param azure_tenant_domain_name: Optional, Domain Name of the Azure tenant. :type azure_tenant_domain_name: str :param azure_cloud_type: AZUREPUBLICCLOUD [default] or AZURECHINACLOUD :type azure_cloud_type: str
- Returns
Status if unsuccessful
- Return type
dict
- Raises
RequestException – If the query to Polaris returned an error
Examples:
-
rubrik_polaris.accounts.azure.
add_account_azure
(self, azure_tenant_domain_name=None, azure_cloud_type='AZUREPUBLICCLOUD', cloud_account_features='CLOUD_NATIVE_PROTECTION', azure_subscription_id=None, azure_subscription_name=None, azure_regions=None)¶ Add Azure subscription to Polaris :param azure_tenant_domain_name: Optional, Domain Name of the Azure tenant. :type azure_tenant_domain_name: str :param azure_cloud_type: AZUREPUBLICCLOUD [default] or AZURECHINACLOUD :type azure_cloud_type: str :param cloud_account_features: Polaris cloud feature - CLOUDNATIVEPROTECTION [default] :type cloud_account_features: str :param azure_subscription_id: Azure Subscription ID :type azure_subscription_id: str :param azure_subscription_name: Azure Subscription friendly name :type azure_subscription_name: str :param azure_regions: Array of Azure Regions :type azure_regions: arr :param azure_policy_version: Azure Policy version :type azure_policy_version: int
- Returns
Status if unsuccessful
- Return type
dict
- Raises
RequestException – If the query to Polaris returned an error
Examples:
-
rubrik_polaris.accounts.azure.
delete_account_azure
(self, cloud_account_features='CLOUD_NATIVE_PROTECTION', azure_subscription_id=None, delete_snapshots=False)¶ Add Azure subscription to Polaris :param cloud_account_features: Polaris cloud feature - CLOUDNATIVEPROTECTION [default] :type cloud_account_features: str :param azure_subscription_id: Subscription ID from Azure :type azure_subscription_id: string :param delete_snapshots: Delete Rubrik snapshots for subscription [default: False] :type delete_snapshots: bool
- Returns
Status if unsuccessful
- Return type
dict
- Raises
RequestException – If the query to Polaris returned an error
Examples:
rubrik_polaris.accounts.gcp module¶
-
rubrik_polaris.accounts.gcp.
get_accounts_gcp
(self, filter='')¶ Retrieves GCP project information from Polaris
- Parameters
filter (str) – Search string to filter results
- Returns
Details of GCP Projects in Polaris
- Return type
dict
- Raises
RequestException – If the query to Polaris returned an error
-
rubrik_polaris.accounts.gcp.
add_project_gcp
(self, service_account_auth_key_file=None, gcp_native_project_id=None, gcp_native_project_number=None, gcp_native_project_name=None)¶ Add GCP project to Polaris
- Parameters
service_account_auth_key_file (str) – Filename of SA .json file
gcp_native_project_id (str) – Project_Id of GCP Project to add
gcp_native_project_number (str) – GCP Project number if ommiting SA
gcp_native_project_name (str) – GCP Project name if omitting SA
- Returns
Status if unsuccessful
- Return type
dict
- Raises
RequestException – If the query to Polaris returned an error
Examples
>>> rubrik.add_project_gcp(service_account_auth_key_file="/home/peterm/.google.milanese.json", gcp_native_project_id="home-network-274622")
-
rubrik_polaris.accounts.gcp.
delete_project_gcp
(self, gcp_native_project_id=None, delete_snapshots=False)¶ Remove GCP project from Polaris
- Parameters
gcp_native_project_id (str) – Project_Id of GCP Project to remove
delete_snapshots (bool) – Should snapshots be removed from Polaris
- Returns
Status if unsuccessful
- Return type
dict
- Raises
RequestException – If the query to Polaris returned an error
Examples
>>> rubrik.delete_project_gcp(gcp_native_project_id="home-network-274622")
-
rubrik_polaris.accounts.gcp.
set_account_gcp_default_sa
(self, service_account_auth_key_file=None, service_account_name=None)¶ Set default SA Key for GCP
- Parameters
service_account_auth_key_file (str) – Filename of SA key file
service_account_name (bool) – Name to reference SA
- Returns
Status if unsuccessful
- Return type
dict
- Raises
RequestException – If the query to Polaris returned an error
Examples
>>> rubrik.set_account_gcp_default_sa(service_account_auth_key_file = "file.json", service_account_name = "sa-2021-03")
-
rubrik_polaris.accounts.gcp.
get_account_gcp_default_sa
(self)¶ Get default SA Key for GCP
- Returns
Name of default GCP Service Account
- Return type
str
- Raises
RequestException – If the query to Polaris returned an error
Examples
>>> rubrik.get_account_gcp_default_sa()
Module contents¶
Collection of functions that interact with Cloud account configuration.