Fleet Manager Instance Templates¶
Instance settings templates allow to set several properties used when creating a new instance.
Create a new settings template¶
import dataikuapi
key_id = "<my key id>"
key_secret = "<my key secret>"
# <Cloud vendor> is either AWS, Azure or GCP
client = dataikuapi.FMClient<Cloud vendor>("https://localhost", key_id, key_secret)
creator = client.new_instance_template_creator("MyTemplate")
# set the properties of your template
...
setting_template = creator.create()
Reference API doc¶
-
class
dataikuapi.fm.instancesettingstemplates.
FMInstanceSettingsTemplate
(client, ist_data)¶ -
save
()¶ Update this template
-
delete
()¶ Delete this template
- Returns
the Future object representing the deletion process
- Return type
-
add_setup_action
(setup_action)¶ Add a setup action
- Parameters
setup_action (
dataikuapi.fm.instancesettingstemplates.FMSetupAction
) – the action to add- Return type
dataikuapi.fm.instancesettingstemplates.FMInstanceSettingsTemplate
-
-
class
dataikuapi.fm.instancesettingstemplates.
FMInstanceSettingsTemplateCreator
(client, label)¶ -
create
()¶ Create a new instance settings template.
- Returns
a newly created template
- Return type
dataikuapi.fm.instancesettingstemplates.FMInstanceSettingsTemplate
-
with_setup_actions
(setup_actions)¶ Add setup actions
- Parameters
setup_actions (list of
dataikuapi.fm.instancesettingstemplates.FMSetupActions
) – List of setup actions to be played on an instance- Return type
dataikuapi.fm.instancesettingstemplates.FMInstanceSettingsTemplateCreator
-
with_license
(license_file_path=None, license_string=None)¶ Override global license
- Parameters
license_file_path (str) – Optional, load the license from a json file
license_string (str) – Optional, load the license from a json string
- Return type
dataikuapi.fm.instancesettingstemplates.FMInstanceSettingsTemplateCreator
-
-
class
dataikuapi.fm.instancesettingstemplates.
FMAWSInstanceSettingsTemplateCreator
(client, label)¶ -
with_aws_keypair
(aws_keypair_name)¶ Add an AWS Keypair to the DSS instance. Needed to get SSH access to the DSS instance, using the centos user.
- Parameters
aws_keypair_name (str) – Name of an AWS key pair to add to the instance.
- Return type
dataikuapi.fm.instancesettingstemplates.FMAWSInstanceSettingsTemplateCreator
-
with_startup_instance_profile
(startup_instance_profile_arn)¶ Add an Instance Profile to be assigned to the DSS instance on startup
- Parameters
startup_instance_profile_arn (str) – ARN of the Instance profile assigned to the DSS instance at startup time
- Return type
dataikuapi.fm.instancesettingstemplates.FMAWSInstanceSettingsTemplateCreator
-
with_runtime_instance_profile
(runtime_instance_profile_arn)¶ Add an Instance Profile to be assigned to the DSS instance when running
- Parameters
runtime_instance_profile_arn (str) – ARN of the Instance profile assigned to the DSS instance during runtime
- Return type
dataikuapi.fm.instancesettingstemplates.FMAWSInstanceSettingsTemplateCreator
-
with_restrict_aws_metadata_server_access
(restrict_aws_metadata_server_access=True)¶ Restrict AWS metadata server access on the DSS instance.
- Parameters
restrict_aws_metadata_server_access (boolean) – Optional, If true, restrict the access to the metadata server access. Defaults to true
- Return type
dataikuapi.fm.instancesettingstemplates.FMAWSInstanceSettingsTemplateCreator
-
with_default_aws_api_access_mode
()¶ The DSS Instance will use the Runtime Instance Profile to access AWS API.
-
with_keypair_aws_api_access_mode
(aws_access_key_id, aws_keypair_storage_mode='NONE', aws_secret_access_key=None, aws_secret_access_key_aws_secret_name=None, aws_secrets_manager_region=None)¶ DSS Instance will use an Access Key to authenticate against the AWS API.
- Parameters
aws_access_key_id (str) – AWS Access Key ID.
aws_keypair_storage_mode (str) – Optional, the storage mode of the AWS api key. Accepts “NONE”, “INLINE_ENCRYPTED” or “AWS_SECRETS_MANAGER”. Defaults to “NONE”
aws_secret_access_key (str) – Optional, AWS Access Key Secret. Only needed if keypair_storage_mode is “INLINE_ENCRYPTED”
aws_secret_access_key_aws_secret_name (str) – Optional, ASM secret name. Only needed if aws_keypair_storage_mode is “AWS_SECRET_MANAGER”
aws_secrets_manager_region (str) – Optional, Secret Manager region to use. Only needed if aws_keypair_storage_mode is “AWS_SECRET_MANAGER”
- Return type
dataikuapi.fm.instancesettingstemplates.FMAWSInstanceSettingsTemplateCreator
-
-
class
dataikuapi.fm.instancesettingstemplates.
FMAzureInstanceSettingsTemplateCreator
(client, label)¶ -
with_ssh_key
(ssh_public_key)¶ Add an SSH public key to the DSS Instance. Needed to access it through SSH, using the centos user.
- Parameters
ssh_public_key (str) – The content of the public key to add to the instance.
- Return type
dataikuapi.fm.instancesettingstemplates.FMAzureInstanceSettingsTemplateCreator
-
with_startup_managed_identity
(startup_managed_identity)¶ Add a managed identity to be assign to the DSS instance on startup
- Parameters
startup_managed_identity (str) – Managed Identity ID
- Return type
dataikuapi.fm.instancesettingstemplates.FMAzureInstanceSettingsTemplateCreator
-
with_runtime_managed_identity
(runtime_managed_identity)¶ Add a managed identity to be assign to the DSS instance when running
- Parameters
runtime_managed_identity (str) – Managed Identity ID
- Return type
dataikuapi.fm.instancesettingstemplates.FMAzureInstanceSettingsTemplateCreator
-
-
class
dataikuapi.fm.instancesettingstemplates.
FMGCPInstanceSettingsTemplateCreator
(client, label)¶ -
with_ssh_key
(ssh_public_key)¶ Add an SSH public key to the DSS Instance. Needed to access it through SSH, using the centos user.
- Parameters
ssh_public_key (str) – The content of the public key to add to the instance.
- Return type
dataikuapi.fm.instancesettingstemplates.FMGCPInstanceSettingsTemplateCreator
-
with_restrict_metadata_server_access
(restrict_metadata_server_access=True)¶ Restrict GCloud metadata server access on the DSS instance.
- Parameters
restrict_metadata_server_access (boolean) – Optional, If true, restrict the access to the metadata server access. Defaults to true
- Return type
dataikuapi.fm.instancesettingstemplates.FMGCPInstanceSettingsTemplateCreator
-
with_block_project_wide_keys
(block_project_wide_keys=True)¶ Restrict GCloud metadata server access on the DSS instance.
- Parameters
block_project_wide_keys (boolean) – Optional, If true, block project-wide ssh keys on the instance. Defaults to true
- Return type
dataikuapi.fm.instancesettingstemplates.FMGCPInstanceSettingsTemplateCreator
-
with_runtime_service_account
(startup_service_account)¶ Add a service account to be assigned to the DSS instance on startup
- Parameters
startup_service_account (str) – service account email
- Return type
dataikuapi.fm.instancesettingstemplates.FMGCPInstanceSettingsTemplateCreator
-
-
class
dataikuapi.fm.instancesettingstemplates.
FMSetupAction
(setupActionType, params=None)¶ Return an ADD_AUTHORIZED_KEY setup action
-
static
run_ansible_task
(stage, yaml_string)¶ Return a RUN_ANSIBLE_TASK setup action
- Parameters
stage (
dataikuapi.fm.instancesettingstemplates.FMSetupActionStage
) – the action stageyaml_string (str) – a yaml encoded string defining the ansibles tasks to run
- Return type
-
static
install_system_packages
(packages)¶ Return an INSTALL_SYSTEM_PACKAGES setup action
- Parameters
packages (list) – List of packages to install
- Return type
-
static
setup_advanced_security
(basic_headers=True, hsts=False)¶ Return a SETUP_ADVANCED_SECURITY setup action
- Parameters
basic_headers (boolean) – Optional, Prevent browsers to render Web content served by DSS to be embedded into a frame, iframe, embed or object tag. Defaults to True
hsts (boolean) – Optional, Enforce HTTP Strict Transport Security. Defaults to False
- Return type
-
static
install_jdbc_driver
(database_type, url, paths_in_archive=None, http_headers=None, http_username=None, http_password=None, datadir_subdirectory=None)¶ Return a INSTALL_JDBC_DRIVER setup action
- Parameters
database_type (
dataikuapi.fm.instancesettingstemplates.FMSetupActionAddJDBCDriverDatabaseType
) – the database typeurl (str) – The full address to the driver. Supports http(s)://, s3://, abs:// or file:// endpoints
paths_in_archive (list) – Optional, must be used when the driver is shipped as a tarball or a ZIP file. Add here all the paths to find the JAR files in the driver archive. Paths are relative to the top of the archive. Wildcards are supported.
http_headers (dict) – Optional, If you download the driver from a HTTP(S) endpoint, add here the headers you want to add to the query. This setting is ignored for any other type of download.
http_username (str) – Optional, If the HTTP(S) endpoint expect a Basic Authentication, add here the username. To explicitely specify which Assigned Identity use if the machine have several, set the client_id here. To authenticate with a SAS Token on Azure Blob Storage (not recommended), use “token” as the value here.
http_password (str) – Optional, If the HTTP(S) endpoint expect a Basic Authentication, add here the password. To authenticate with a SAS Token on Azure Blob Storage (not recommended), store the token in this field.
datadir_subdirectory (str) – Optional, Some drivers are shipped with a high number of JAR files along with them. In that case, you might want to install them under an additional level in the DSS data directory. Set the name of this subdirectory here. Not required for most drivers.
- Return type
-
static
setup_k8s_and_spark
()¶ Return a SETUP_K8S_AND_SPARK setup action