The main FMClient class¶
The REST API Python client makes it easy to write client programs for the Fleet Manager REST API in Python. The REST API Python client is in the dataikuapi
Python package.
The client is the entrypoint for many of the capabilities listed in this chapter.
Creating a Fleet Manager client¶
To work with the API, a connection needs to be established with Fleet Manager, by creating an FMClient
object. Once the connection is established, the FMClient
object serves as the entry point to the other calls.
Depending on your cloud provider, you will have to create the dedicated FMClient
:
a
FMClientAWS
for Amazon Web Servicesa
FMClientAzure
for Microsoft Azurea
FMClientGCP
for Google Cloud Platform
To connect you will need to provide the URL of your Fleet Manager server, and a key identifier and secret
import dataikuapi
key_id = "<my key id>"
key_secret = "<my key secret>"
client = dataikuapi.FMClientAWS("https://localhost", key_id, key_secret)
client = dataikuapi.FMClientAzure("https://localhost", key_id, key_secret)
client = dataikuapi.FMClientGCP("https://localhost", key_id, key_secret)
# client is now a FMClient and can perform all authorized actions.
# For example, list the DSS instances in the fleet for which you have access
client.list_instances()
Reference API doc¶
-
class
dataikuapi.fmclient.
FMClient
(host, api_key_id, api_key_secret, tenant_id='main', extra_headers=None)¶ -
get_cloud_credentials
()¶ Get the cloud credentials
- Returns
cloud credentials
- Return type
Get the tenant’s cloud tags
- Returns
tenant’s cloud tags
- Return type
-
list_virtual_networks
()¶ List all virtual networks
- Returns
list of virtual networks
- Return type
-
get_virtual_network
(virtual_network_id)¶ Get a virtual network by its id
- Parameters
virtual_network_id (str) – the id of the network to retrieve
- Returns
the requested virtual network
- Return type
-
list_instance_templates
()¶ List all instance settings templates
- Returns
list of instance settings template
- Return type
list of
dataikuapi.fm.tenant.FMInstanceSettingsTemplate
-
get_instance_template
(template_id)¶ Get an instance setting template template by its id
- Parameters
template_id (str) – the id of the template to retrieve
- Returns
the requested instance settings template
- Return type
dataikuapi.fm.instancesettingstemplates.FMInstanceSettingsTemplate
-
list_instances
()¶ List all DSS instances
- Returns
list of instances
- Return type
-
get_instance
(instance_id)¶ Get a DSS instance by its id
- Parameters
instance_id (str) – the id of the instance to retrieve
- Returns
the requested instance if any
- Return type
-
list_instance_images
()¶ List all available images to create new instances
- Returns
list of images, as a pair of id and label
-
-
class
dataikuapi.fmclient.
FMClientAWS
(host, api_key_id, api_key_secret, tenant_id='main', extra_headers=None)¶ -
new_virtual_network_creator
(label)¶ Instantiate a new virtual network creator
- Parameters
label (str) – The label of the network
- Return type
-
new_instance_template_creator
(label)¶ Instantiate a new instance template creator
- Parameters
label (str) – The label of the instance
- Return type
dataikuapi.fm.instancesettingstemplates.FMAWSInstanceSettingsTemplateCreator
-
new_instance_creator
(label, instance_settings_template_id, virtual_network_id, image_id)¶ Instantiate a new instance creator
- Parameters
label (str) – The label of the instance
instance_settings_template (str) – The instance settings template id this instance should be based on
virtual_network (str) – The virtual network where the instance should be spawned
image_id (str) – The ID of the DSS runtime image (ex: dss-9.0.3-default)
- Return type
-
-
class
dataikuapi.fmclient.
FMClientAzure
(host, api_key_id, api_key_secret, tenant_id='main', extra_headers=None)¶ -
new_virtual_network_creator
(label)¶ Instantiate a new virtual network creator
- Parameters
label (str) – The label of the network
- Return type
-
new_instance_template_creator
(label)¶ Instantiate a new instance template creator
- Parameters
label (str) – The label of the instance
- Return type
dataikuapi.fm.instancesettingstemplates.FMAzureInstanceSettingsTemplateCreator
-
new_instance_creator
(label, instance_settings_template_id, virtual_network_id, image_id)¶ Instantiate a new instance creator
- Parameters
label (str) – The label of the instance
instance_settings_template (str) – The instance settings template id this instance should be based on
virtual_network (str) – The virtual network where the instance should be spawned
image_id (str) – The ID of the DSS runtime image (ex: dss-9.0.3-default)
- Return type
-
-
class
dataikuapi.fmclient.
FMClientGCP
(host, api_key_id, api_key_secret, tenant_id='main', extra_headers=None)¶ -
new_virtual_network_creator
(label)¶ Instantiate a new virtual network creator
- Parameters
label (str) – The label of the network
- Return type
-
new_instance_template_creator
(label)¶ Instantiate a new instance template creator
- Parameters
label (str) – The label of the instance
- Return type
dataikuapi.fm.instancesettingstemplates.FMGCPInstanceSettingsTemplateCreator
-
new_instance_creator
(label, instance_settings_template_id, virtual_network_id, image_id)¶ Instantiate a new instance creator
- Parameters
label (str) – The label of the instance
instance_settings_template (str) – The instance settings template id this instance should be based on
virtual_network (str) – The virtual network where the instance should be spawned
image_id (str) – The ID of the DSS runtime image (ex: dss-9.0.3-default)
- Return type
-