Package: ionosenterprise
Python SDKVersion: ionosenterprise-sdk-python5.5.0Table of ContentsDescriptionGetting StartedInstallationAuthenticatingError HandlingReferenceData CentersList Data CentersRetrieve a Data CenterCreate a Data CenterUpdate a Data CenterDelete a Data CenterLocationsList LocationsGet a LocationServersList ServersRetrieve a ServerCreate a ServerUpdate a ServerDelete a ServerList Attached VolumesAttach a VolumeRetrieve an Attached VolumeDetach a VolumeList Attached CD-ROMsAttach a CD-ROMRetrieve an Attached CD-ROMDetach a CD-ROMReboot a ServerStart a ServerStop a ServerImagesList ImagesGet an ImageUpdate an ImageDelete an ImageVolumesList VolumesGet a VolumeCreate a VolumeUpdate a VolumeDelete a VolumeCreate a Volume SnapshotRestore a Volume SnapshotSnapshotsList SnapshotsGet a SnapshotUpdate a SnapshotDelete a SnapshotIP BlocksList IP BlocksGet an IP BlockCreate an IP BlockDelete an IP BlockLANsList LANsCreate a LANGet a LANGet LAN MembersUpdate a LANDelete a LANNetwork Interfaces (NICs)List NICsGet a NICCreate a NICUpdate a NICDelete a NICFirewall RulesList Firewall RulesGet a Firewall RuleCreate a Firewall RuleUpdate a Firewall RuleDelete a Firewall RuleLoad BalancersList Load BalancersGet a Load BalancerCreate a Load BalancerUpdate a Load BalancerList Load Balanced NICsGet a Load Balanced NICAssociate NIC to a Load BalancerRemove a NIC AssociationUser ManagementList GroupsGet a GroupCreate a GroupUpdate a GroupDelete a GroupList SharesGet a ShareAdd a ShareUpdate a ShareDelete a ShareList UsersGet a UserCreate a UserUpdate a UserDelete a UserList Users in a GroupAdd User to GroupRemove User from a GroupList ResourcesGet a ResourceContract ResourcesList Contract ResourcesRequestsList RequestsGet a RequestGet a Request StatusKubernetesList Kubernetes ClustersCreate a Kubernetes ClusterRetrieve a Kubernetes ClusterDelete a Kubernetes ClusterRetrieve a Kubernetes Cluster KubeConfigList Kubernetes NodePoolsCreate a NodePool for a Kubernetes ClusterRetrieve a NodePoolDelete a NodePoolUpdate a NodePoolPrivate Cross ConnectsList Private Cross-ConnectsCreate a Private Cross-ConnectRetrieve a private cross-connectDelete a private cross-connectUpdate a private cross-connectS3 KeysList S3 KeysCreate a S3 keyGet S3 keyUpdate a S3 keyDelete a S3 keyGet S3 sso urlBackup UnitsList backup unitsCreate a backup unitGet a backup unitUpdate a Backup UnitDelete a Backup UnitGet SSO UrlExamplesList All Data CentersSearch for ImagesReserve an IP BlockWait for ResourcesComponent BuildComposite BuildSupportTestingContributingDescriptionThe IonosEnterprise SDK for Python provides you with access to the IonosEnterprise API. The client library supports both simple and complex requests. It is designed for developers who are building applications in Python.This guide will walk you through getting setup with the library and performing various actions against the API.The SDK for Python wraps the IonosEnterprise API. All API operations are performed over SSL and authenticated using your IonosEnterprise portal credentials. The API can be accessed within an instance running in IonosEnterprise or directly over the Internet from any application that can send an HTTPS request and receive an HTTPS response.Getting StartedBefore you begin you will need to havesigned-upfor a IonosEnterprise account. The credentials you setup during sign-up will be used to authenticate against the IonosEnterprise API.InstallationThe IonosEnterprise SDK for Python is available onPyPi. You can install the latest stable version usingpip:pip install ionosenterpriseDone!AuthenticatingConnecting to IonosEnterprise is handled by first setting up your authentication credentials.from ionosenterprise.client import IonosEnterpriseService

client = IonosEnterpriseService(
    username='YOUR_USERNAME', password='YOUR_PASSWORD')Replace the values forYOUR_USERNAMEandYOUR_PASSWORDwith the IonosEnterprise credentials you established during sign-up.You can now useclientfor any future request.Error HandlingThe SDK will raise custom exceptions when the IonosEnterprise API returns an error. There are five exception types:ExceptionHTTP CodeDescriptionICNotAuthorizedError401The supplied user credentials are invalid.ICNotFoundError404The requested resource cannot be found.ICValidationError422The request body includes invalid JSON.ICRateLimitExceededError429The API rate limit has been exceeded.ICErrorOtherA generic exception for all other status codes.ReferenceThis section provides details on all the available operations and the arguments they accept. Brief code snippets demonstrating usage are also included.clientis theIonosEnterpriseServiceclass importedfrom ionosenterprise.client import IonosEnterpriseServiceDepthMany of theget_orlist_operations will accept an optionaldepthargument. Setting this to a value between 0 and 5 affects the amount of data that is returned. The detail returned varies somewhat depending on the resource being queried, however it generally follows this pattern.DepthDescription0Only direct properties are included. Children are not included.1Direct properties and children's references are returned.2Direct properties and children's properties are returned.3Direct properties, children's properties, and descendant's references are returned.4Direct properties, children's properties, and descendant's properties are returned.5Returns all available properties.This SDK sets thedepth=1by default as that works well in the majority of cases. You may find that settingdepthto a lower or higher value could simplify a later operation by reducing or increasing the data available in the response object.Data CentersVirtual Data Centers (VDCs) are the foundation of the IonosEnterprise platform. VDCs act as logical containers for all other objects you will be creating, e.g., servers. You can provision as many VDCs as you want. VDCs have their own private network and are logically segmented from each other to create isolation.List Data CentersThis operation will list all currently provisioned VDCs that your account credentials provide access to.There are no request arguments that need to be supplied. You may supply the optionaldepthargument.NameRequiredTypeDescriptiondepthnointAn integer value of 0 - 5 that affects the amount of detail returned. See theDepthsection.Calllist_datacenters:response = client.list_datacenters()Retrieve a Data CenterUse this to retrieve details about a specific VDC.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.depthnointAn integer value of 0 - 5 that affects the amount of detail returned. See theDepthsection.Pass the arguments toget_datacenter:response = client.get_datacenter(datacenter_id='UUID')Create a Data CenterUse this operation to create a new VDC. You can create a "simple" VDC by supplying just the requirednameandlocationarguments. This operation also has the capability of provisioning a "complex" VDC by supplying additional arguments for servers, volumes, LANs, and/or load balancers.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenteryesobjectADatacenter objectdescribing the VDC being created.Build theDatacenterresource object:datacenter = Datacenter(
    name='Data Center Name',
    description='My new data center',
    location='de/fkb')Pass the object tocreate_datacenter:response = client.create_datacenter(datacenter=datacenter)Datacenter Resource ObjectNameRequiredTypeDescriptionnameyesstringThe name of the VDC.locationyesstringThe physical IonosEnterprise location where the VDC will be created.descriptionnostringA description for the VDC, e.g. staging, production.serversnolistA list of one or moreServer objectsto be created.volumesnolistA list of one or moreVolume objectsto be created.lansnolistA list of one or moreLAN objectsto be created.loadbalancersnolistA list of one or moreLoadBalancer objectsto be created.The following table outlines the locations currently supported:ValueCountryCityus/lasUnited StatesLas Vegasus/ewrUnited StatesNewarkde/fraGermanyFrankfurtde/fkbGermanyKarlsruheNOTES:The value fornamecannot contain the following characters: (@, /, , |, ‘’, ‘).You cannot change the VDClocationonce it has been provisioned.Update a Data CenterAfter retrieving a VDC, either by ID or as a create response object, you can change its properties by calling theupdate_datacentermethod. Some arguments may not be changed usingupdate_datacenter.The following table describes the available request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.namenostringThe new name of the VDC.descriptionnostringThe new description of the VDC.Pass the arguments toupdate_datacenter:response = client.update_datacenter(
    datacenter_id='UUID',
    name='New Name'
    description='New description')Delete a Data CenterThis will remove all objects within the VDC and remove the VDC object itself.NOTE: This is a highly destructive operation which should be used with extreme caution!The following table describes the available request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC that you want to delete.Pass the argument todelete_datacenter:response = client.delete_datacenter(datacenter_id='UUID')LocationsLocations are the physical IonosEnterprise data centers where you can provision your VDCs.List LocationsThelist_locationsoperation will return the list of currently available locations.There are no request arguments to supply.response = client.list_locations()Get a LocationRetrieves the attributes of a specific location.The following table describes the request arguments:NameRequiredTypeDescriptionlocation_idyesstringThe ID consisting of country/city.Pass the argument toget_location:client.get_location('us/las')ServersList ServersYou can retrieve a list of all the servers provisioned inside a specific VDC.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.depthnointAn integer value of 0 - 5 that affects the amount of detail returned. See theDepthsection.Pass the arguments tolist_servers:response = client.list_servers(datacenter_id='UUID')Retrieve a ServerReturns information about a specific server such as its configuration, provisioning status, etc.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Pass the arguments toget_server:response = client.get_server(
    datacenter_id='UUID',
    server_id='UUID')Create a ServerCreates a server within an existing VDC. You can configure additional properties such as specifying a boot volume and connecting the server to a LAN.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.serveryesobjectAServer objectdescribing the server being created.Build aServerobject:server = Server(
    name='Server Name',
    cores=1,
    ram=2048,
    description='My new server',
    location='de/fkb')Pass the object and other arguments tocreate_server:response = client.create_server(
    datacenter_id='UUID',
    server=server)Server Resource ObjectNameRequiredTypeDescriptionnameyesstringThe name of the server.coresyesintThe total number of cores for the server.ramyesintThe amount of memory for the server in MB, e.g. 2048. Size must be specified in multiples of 256 MB with a minimum of 256 MB; however, if you setram_hot_plugtoTruethen you must use a minimum of 1024 MB.availability_zonenostringThe availability zone in which the server should exist.cpu_familynostringSets the CPU type. "AMD_OPTERON" or "INTEL_XEON". Defaults to "AMD_OPTERON".boot_volume_idnostringA volume ID that the server will boot from. If notnullthenboot_cdromhas to benull.boot_cdromnostringA CD-ROM image ID used for booting. If notnullthenboot_volume_idhas to benull.attach_volumesnolistA list of existing volume IDs that you want to connect to the server.create_volumesnolistOne or moreVolume objectsthat you want to create and attach to the server.nicsnolistOne or moreNIC objectsthat you wish to create at the time the server is provisioned.The following table outlines the server availability zones currently supported:Availability ZoneCommentAUTOAutomatically Selected ZoneZONE_1Fire Zone 1ZONE_2Fire Zone 2Update a ServerPerform updates to the attributes of a server.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.namenostringThe name of the server.coresnointThe number of cores for the server.ramnointThe amount of memory in the server.availability_zonenostringThe new availability zone for the server.cpu_familynostringSets the CPU type. "AMD_OPTERON" or "INTEL_XEON". Defaults to "AMD_OPTERON".boot_volume_idnostringA volume ID used for booting. If notnullthenboot_cdromhas to benull.boot_cdromnostringA CD-ROM image ID used for booting. If notnullthenboot_volume_idhas to benull.Pass the arguments toupdate_server:response = client.update_server(
    datacenter_id='UUID',
    server_id='UUID',
    name='New Name')Delete a ServerThis will remove a server from a VDC.NOTE: This will not automatically remove the storage volume(s) attached to a server. A separate operation is required to delete a storage volume.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server that will be deleted.Pass the arguments todelete_server:response = client.delete_server(
    datacenter_id='UUID',
    server_id='UUID')List Attached VolumesRetrieves a list of volumes attached to the server.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Pass the arguments toget_attached_volumes:response = client.get_attached_volumes(
    datacenter_id='UUID',
    server_id='UUID')Attach a VolumeThis will attach a pre-existing storage volume to the server.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.volume_idyesstringThe ID of a storage volume.Pass the arguments toattach_volume:response = client.attach_volume(
    datacenter_id='UUID',
    server_id='UUID',
    volume_id='UUID')Retrieve an Attached VolumeThis will retrieve the properties of an attached volume.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.volume_idyesstringThe ID of the attached volume.Pass the arguments toget_attached_volume:response = client.get_attached_volume(
    datacenter_id='UUID',
    server_id='UUID',
    volume_id='UUID')Detach a VolumeThis will detach the volume from the server. Depending on the volumehot_unplugsettings, this may result in the server being rebooted. Ifdisc_virtio_hot_unplughas been set totrue, then a reboot should not be required.This willNOTdelete the volume from your VDC. You will need to make a separate request to delete a volume.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.volume_idyesstringThe ID of the attached volume.Pass the arguments todetach_volume:response = client.detach_volume(
    datacenter_id='UUID',
    server_id='UUID',
    volume_id='UUID')List Attached CD-ROMsRetrieves a list of CD-ROMs attached to a server.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Pass the arguments toget_attached_cdroms:response = client.get_attached_cdroms(
    datacenter_id='UUID',
    server_id='UUID')Attach a CD-ROMYou can attach a CD-ROM to an existing server.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.cdrom_idyesstringThe ID of a CD-ROM.Pass the arguments toattach_cdrom:response = client.attach_cdrom(
    datacenter_id='UUID',
    server_id='UUID',
    cdrom_id='UUID')Retrieve an Attached CD-ROMYou can retrieve a specific CD-ROM attached to the server.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.cdrom_idyesstringThe ID of the attached CD-ROM.Pass the arguments toget_attached_cdrom:response = client.get_attached_cdrom(
    datacenter_id='UUID',
    server_id='UUID',
    cdrom_id='UUID')Detach a CD-ROMThis will detach a CD-ROM from the server.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.cdrom_idyesstringThe ID of the attached CD-ROM.Pass the arguments todetach_cdrom:response = client.detach_cdrom(
    datacenter_id='UUID',
    server_id='UUID',
    cdrom_id='UUID')Reboot a ServerThis will force a hard reboot of the server. Do not use this method if you want to gracefully reboot the machine. This is the equivalent of powering off the machine and turning it back on.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.Pass the arguments toreboot_server:response = client.reboot_server(
    datacenter_id='UUID',
    server_id='UUID')Start a ServerThis will start a server. If a DHCP assigned public IP was deallocated when the server was stopped, then a new IP will be assigned.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.Pass the arguments tostart_server:response = client.start_server(
    datacenter_id='UUID',
    server_id='UUID')Stop a ServerThis will stop a server. The machine will be forcefully powered off, billing will cease, and the public IP, if one is allocated, will be deallocated.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.Pass the arguments tostop_server:response = client.stop_server(
    datacenter_id='UUID',
    server_id='UUID')ImagesList ImagesRetrieve a list of images.The following table describes the request arguments:NameRequiredTypeDescriptiondepthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Pass the arguments tolist_images:response = client.list_images()Get an ImageRetrieves the attributes of a specific image.The following table describes the request arguments:NameRequiredTypeDescriptionimage_idyesstringThe ID of the image.Pass the arguments toget_image:response = client.get_image('UUID')Update an ImageUpdates the attributes of a specific user created image. YouCANNOTupdate the properties of a public image supplied by IonosEnterprise.The following table describes the request arguments:NameRequiredTypeDescriptionimage_idyesstringThe ID of the image.namenostringThe name of the image.descriptionnostringThe description of the image.licence_typenostringThe snapshot's licence type: LINUX, WINDOWS, WINDOWS2016, UNKNOWN or OTHER.cpu_hot_plugnoboolThis volume is capable of CPU hot plug (no reboot required)cpu_hot_unplugnoboolThis volume is capable of CPU hot unplug (no reboot required)ram_hot_plugnoboolThis volume is capable of memory hot plug (no reboot required)ram_hot_unplugnoboolThis volume is capable of memory hot unplug (no reboot required)nic_hot_plugnoboolThis volume is capable of NIC hot plug (no reboot required)nic_hot_unplugnoboolThis volume is capable of NIC hot unplug (no reboot required)disc_virtio_hot_plugnoboolThis volume is capable of VirtIO drive hot plug (no reboot required)disc_virtio_hot_unplugnoboolThis volume is capable of VirtIO drive hot unplug (no reboot required)disc_scsi_hot_plugnoboolThis volume is capable of SCSI drive hot plug (no reboot required)disc_scsi_hot_unplugnoboolThis volume is capable of SCSI drive hot unplug (no reboot required)You can change an image's properties by calling theupdate_imagemethod:response = client.update_image(
    image_id='UUID',
    name='New Name',
    description='New description',
    licence_type='LINUX')Delete an ImageDeletes a specific user created image. You cannot delete public images supplied by IonosEnterprise.The following table describes the request arguments:NameRequiredTypeDescriptionimage_idyesstringThe ID of the image.Pass the arguments todelete_image:response = client.delete_image('UUID')VolumesList VolumesRetrieve a list of volumes within the VDC. If you want to retrieve a list of volumes attached to a server please see theList Attached Volumesentry in the Server section for details.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Pass the arguments tolist_volumes:response = client.list_volumes(datacenter_id='UUID')Get a VolumeRetrieves the attributes of a given volume.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.volume_idyesstringThe ID of the volume.Pass the arguments toget_volume:response = client.get_volume(
    datacenter_id='UUID',
    volume_id='UUID')Create a VolumeCreates a volume within the VDC. This will NOT attach the volume to a server. Please see theAttach a Volumeentry in the Server section for details on how to attach storage volumes.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.volumeyesobjectAVolume objectyou wish to create.Build theVolumeresource object:volume = Volume(
    name='name',
    size=20,
    bus='VIRTIO',
    type='HDD',
    licence_type='LINUX',
    availability_zone='ZONE_3')Pass the object and arguments tocreate_volume:response = client.create_volume(
    datacenter_id='UUID',
    volume=volume)Volume Resource ObjectNameRequiredTypeDescriptionnamenostringThe name of the volume.sizeyesintThe size of the volume in GB.busnostringThe bus type of the volume (VIRTIO or IDE). Default: VIRTIO.imageyesstringThe image or snapshot ID. Can be left empty for a data volume, however you'll need to set thelicence_type. Default:nullimage_aliasyesstringThe alias of the image.typeyesstringThe volume type, HDD or SSD. Default: HDDlicence_typeyesstringThe licence type of the volume. Options: LINUX, WINDOWS, WINDOWS2016, UNKNOWN, OTHER. Default: UNKNOWNimage_passwordyesstringA password to set on the volume for the appropriate root or administrative account. This field may only be set in creation requests. When reading, it always returnsnull. The password has to contain 8-50 characters. Only these characters are allowed: [abcdefghjkmnpqrstuvxABCDEFGHJKLMNPQRSTUVX23456789]ssh_keysyesstringSSH keys to allow access to the volume via SSH.availability_zonenostringThe storage availability zone assigned to the volume. Valid values: AUTO, ZONE_1, ZONE_2, or ZONE_3. This only applies to HDD volumes. Leave blank or set to AUTO when provisioning SSD volumes.The following table outlines the various licence types you can define:Licence TypeCommentWINDOWS2016Use this for the Microsoft Windows Server 2016 operating system.WINDOWSUse this for the Microsoft Windows Server 2008 and 2012 operating systems.LINUXUse this for Linux distributions such as CentOS, Ubuntu, Debian, etc.OTHERUse this for any volumes that do not match one of the other licence types.UNKNOWNThis value may be inherited when you've uploaded an image and haven't set the license type. Use one of the options above instead.The following table outlines the storage availability zones currently supported:Availability ZoneCommentAUTOAutomatically Selected ZoneZONE_1Fire Zone 1ZONE_2Fire Zone 2ZONE_3Fire Zone 3Note:You will need to provide either theimageor thelicence_typearguments when creating a volume. Alicence_typeis required, but ifimageis supplied, it is already set and cannot be changed. Either theimage_passwordorssh_keysarguments need to be supplied when creating a volume using one of the official IonosEnterprise images. Only official IonosEnterprise provided images support thessh_keysandimage_passwordarguments.Update a VolumeYou can update various attributes of an existing volume; however, some restrictions are in place:You can increase the size of an existing storage volume. You cannot reduce the size of an existing storage volume. The volume size will be increased without requiring a reboot if the relevant hot plug settings (disc_virtio_hot_plug,disc_virtio_hot_unplug, etc.) have been set totrue. The additional capacity is not added automatically added to any partition, therefore you will need to handle that inside the OS afterwards. Once you have increased the volume size you cannot decrease the volume size.Since an existing volume is being modified, none of the request arguments are specifically required as long as the changes being made satisfy the requirements for creating a volume.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.volume_idyesstringThe ID of the volume.namenostringThe name of the volume.sizenointThe size of the volume in GB. You may only increase thesizewhen updating.busnostringThe bus type of the volume (VIRTIO or IDE). Default: VIRTIO.licence_typenostringThe licence type of the volume. Options: LINUX, WINDOWS, WINDOWS2016, UNKNOWN, OTHER. You may get an error trying to updatelicence_typedepending on theimagethat was used to create the volume. For example, you cannot update thelicence_typefor a volume created from a IonosEnterprise supplied OS image.Note: Trying to change theimage,type, oravailability_zonein an update request will result in an error.Pass the arguments toupdate_volume:response = client.update_volume(
    datacenter_id='UUID',
    volume_id='UUID',
    size=6,
    name='New Name')Delete a VolumeDeletes the specified volume. This will result in the volume being removed from your data center. Use this with caution.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.volume_idyesstringThe ID of the volume.Pass the arguments todelete_volume:response = client.delete_volume(
    datacenter_id='UUID',
    volume_id='UUID')Create a Volume SnapshotCreates a snapshot of a volume within the VDC. You can use a snapshot to create a new storage volume or to restore a storage volume.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.volume_idyesstringThe ID of the volume.namenostringThe name of the snapshot.descriptionnostringThe description of the snapshot.Pass the arguments tocreate_snapshot:response = client.create_snapshot(
    datacenter_id='UUID',
    volume_id='UUID',
    name='Snapshot Name',
    description='Snapshot description')Restore a Volume SnapshotThis will restore a snapshot onto a volume. A snapshot is created as just another image that can be used to create new volumes or to restore an existing volume.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.volume_idyesstringThe ID of the volume.snapshot_idyesstringThe ID of the snapshot.Pass the arguments torestore_snapshot:response = client.restore_snapshot(
    datacenter_id='UUID',
    volume_id='UUID',
    snapshot_id='UUID')SnapshotsList SnapshotsYou can retrieve a list of all available snapshots.NameRequiredTypeDescriptiondepthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Pass the arguments tolist_snapshots:response = client.list_snapshots()Get a SnapshotRetrieves the attributes of a specific snapshot.The following table describes the request arguments:NameRequiredTypeDescriptionsnapshot_idyesstringThe ID of the snapshot.Pass the arguments toget_snapshot:response = client.get_snapshot(snapshot_id='UUID')Update a SnapshotPerform updates to attributes of a snapshot.The following table describes the request arguments:NameRequiredTypeDescriptionsnapshot_idyesstringThe ID of the snapshot.namenostringThe name of the snapshot.descriptionnostringThe description of the snapshot.licence_typenostringThe snapshot's licence type: LINUX, WINDOWS, WINDOWS2016, UNKNOWN or OTHER.cpu_hot_plugnoboolThis volume is capable of CPU hot plug (no reboot required)cpu_hot_unplugnoboolThis volume is capable of CPU hot unplug (no reboot required)ram_hot_plugnoboolThis volume is capable of memory hot plug (no reboot required)ram_hot_unplugnoboolThis volume is capable of memory hot unplug (no reboot required)nic_hot_plugnoboolThis volume is capable of NIC hot plug (no reboot required)nic_hot_unplugnoboolThis volume is capable of NIC hot unplug (no reboot required)disc_virtio_hot_plugnoboolThis volume is capable of VirtIO drive hot plug (no reboot required)disc_virtio_hot_unplugnoboolThis volume is capable of VirtIO drive hot unplug (no reboot required)disc_scsi_hot_plugnoboolThis volume is capable of SCSI drive hot plug (no reboot required)disc_scsi_hot_unplugnoboolThis volume is capable of SCSI drive hot unplug (no reboot required)Pass the arguments toupdate_snapshot:response = client.update_snapshot(
    snapshot_id='UUID',
    name='New Name',
    description='New description')Delete a SnapshotDeletes the specified snapshot.The following table describes the request arguments:NameRequiredTypeDescriptionsnapshot_idyesstringThe ID of the snapshot.Pass the arguments todelete_snapshot:response = client.delete_snapshot(snapshot_id='deleting_snapshot_id')IP BlocksThe IP block operations assist with managing reserved /static public IP addresses.List IP BlocksRetrieve a list of available IP blocks.The following table describes the request arguments:NameRequiredTypeDescriptiondepthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Pass the arguments tolist_ipblocks:response = client.list_ipblocks()Get an IP BlockRetrieves the attributes of a specific IP block.The following table describes the request arguments:NameRequiredTypeDescriptionipblock_idyesstringThe ID of the IP block.Pass the arguments toget_ipblock:response = client.get_ipblock('UUID')Create an IP BlockCreates an IP block. Creating an IP block is a bit different than some of the other available create operations. IP blocks are not attached to a particular VDC, but rather to a location. Therefore, you must specify a validlocationalong with asizeargument indicating the number of IP addresses you want to reserve in the IP block. Any resources using an IP address from an IP block must be in the samelocation.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.ipblockyesobjectAnIPBlock objectyou wish to create.To create an IP block, define theIPBlockresource object:ipblock = IPBlock(
    name='IP Block Name',
    size=4,
    location='de/fkb')Pass it toreserve_ipblock:response = client.reserve_ipblock(ipblock)IPBlock Resource ObjectNameRequiredTypeDescriptionlocationyesstringThis must be one of the locations: us/las, us/ewr, de/fra, de/fkb.sizeyesintThe size of the IP block you want.namenostringA descriptive name for the IP blockThe following table outlines the locations currently supported:ValueCountryCityus/lasUnited StatesLas Vegasus/ewrUnited StatesNewarkde/fraGermanyFrankfurtde/fkbGermanyKarlsruheDelete an IP BlockDeletes the specified IP Block.The following table describes the request arguments:NameRequiredTypeDescriptionipblock_idyesstringThe ID of the IP block.Pass the arguments todelete_ipblock:response = client.delete_ipblock('UUID')LANsList LANsRetrieve a list of LANs within the VDC.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Pass the arguments tolist_lans:response = client.list_lans(datacenter_id='UUID')Create a LANCreates a LAN within a VDC.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.lanyesobjectALAN objectdescribing the LAN to create.Create theLANresource object:lan = LAN(
    name='LAN Name',
    public=True)Pass the object and arguments tocreate_lan:response = client.create_lan(
    datacenter_id='UUID',
    lan=lan)LAN Resource ObjectNameRequiredTypeDescriptionnamenostringThe name of your LAN.publicYesboolBoolean indicating if the LAN faces the public Internet or not.nicsnolistOne or more NIC IDs attached to the LAN.pccnostringUnique identifier of the private cross connect the given LAN is connected to if any.Get a LANRetrieves the attributes of a given LAN.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.lan_idyesintThe ID of the LAN.depthnointAn integer value of 0 - 5 that affects the amount of detail returned. See theDepthsection.Pass the arguments toget_lan:response = client.get_lan(
    datacenter_id='UUID',
    lan_id=ID)Get LAN MembersRetrieves the list of NICs that are part of the LAN.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.lan_idyesintThe ID of the LAN.depthnointAn integer value of 0 - 5 that affects the amount of detail returned. See theDepthsection.Pass the arguments toget_lan_members:response = client.get_lan_members(
    datacenter_id='UUID',
    lan_id=ID)Update a LANPerform updates to attributes of a LAN.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.lan_idyesintThe ID of the LAN.namenostringA descriptive name for the LAN.publicnoboolBoolean indicating if the LAN faces the public Internet or not.ip_failovernolistA list of IP fail-over dicts.Pass the arguments toupdate_lan:ip_failover = dict()
ip_failover['ip'] = 'IP_address'
ip_failover['nicUuid'] = 'UUID'

response = client.update_lan(
    datacenter_id='UUID',
    lan_id=ID,
    name='New LAN Name',
    public=True,
    ip_failover=[ip_failover])Delete a LANDeletes the specified LAN.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.lan_idyesstringThe ID of the LAN.Pass the arguments todelete_lan:response = client.delete_lan(
    datacenter_id='datacenter_id',
    lan_id=ID)Network Interfaces (NICs)List NICsRetrieve a list of LANs within the VDC.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.depthnointAn integer value of 0 - 5 that affects the amount of detail returned. See theDepthsection.Pass the arguments tolist_nics:response = client.list_nics(
    datacenter_id='UUID',
    server_id='UUID')Get a NICRetrieves the attributes of a given NIC.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.nic_idyesstringThe ID of the NIC.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Pass the arguments toget_nic:response = client.get_nic(
    datacenter_id='UUID',
    server_id='UUID',
    nic_id='UUID')Create a NICAdds a NIC to the target server.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.nicyesobjectANIC objectdescribing the NIC to be created.Create theNICresource object:nic = NIC(
    name='NIC Name',
    dhcp=True,
    lan=1,
    nat=False)Pass the object and arguments tocreate_nic:response = client.create_nic(
    datacenter_id='UUID',
    server_id='UUID',
    nic=nic)NIC Resource ObjectNameRequiredTypeDescriptionnamenostringThe name of the NIC.ipsnolistIP addresses assigned to the NIC.dhcpnoboolSet tofalseif you wish to disable DHCP on the NIC. Default:true.lanyesintThe LAN ID the NIC will sit on. If the LAN ID does not exist it will be created.natnoboolIndicates the private IP address has outbound access to the public internet.firewall_activenoboolSet this totrueto enable the IonosEnterprise firewall,falseto disable.firewall_rulesnolistA list ofFirewallRule objectsto be created with the NIC.Update a NICYou can update -- in full or partially -- various attributes on the NIC; however, some restrictions are in place:The primary address of a NIC connected to a load balancer can only be changed by changing the IP of the load balancer. You can also add additional reserved, public IPs to the NIC.The user can specify and assign private IPs manually. Valid IP addresses for private networks are 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.nic_idyesstringThe ID of the NIC.namenostringThe name of the NIC.ipsnolistIPs assigned to the NIC represented as a list of strings.dhcpnoboolBoolean value that indicates if the NIC is using DHCP or not.lannointThe LAN ID the NIC sits on.natnoboolIndicates the private IP address has outbound access to the public internet.firewall_activenoboolSet this totrueto enable the IonosEnterprise firewall,falseto disable.Pass the arguments toupdate_nic:response = client.update_nic(
    datacenter_id='UUID',
    server_id='UUID',
    nic_id='UUID',
    name='New Name')Delete a NICDeletes the specified NIC.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.nic_idyesstringThe ID of the NIC.Pass the arguments todelete_nic:response = client.delete_nic(
    datacenter_id='UUID',
    server_id='UUID',
    nic_id='UUID')Firewall RulesList Firewall RulesRetrieves a list of firewall rules associated with a particular NIC.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.nic_idyesstringThe ID of the NIC.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Pass the arguments toget_firewall_rules:response = client.get_firewall_rules(
    datacenter_id='UUID',
    server_id='UUID',
    nic_id='UUID')Get a Firewall RuleRetrieves the attributes of a given firewall rule.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.nic_idyesstringThe ID of the NIC.firewall_rule_idyesstringThe ID of the firewall rule.Pass the arguments toget_firewall_rule:response = client.get_firewall_rule(
    datacenter_id='UUID',
    loadbalancer_id='UUID',
    nic_id='UUID',
    firewall_rule_id='UUID')Create a Firewall RuleThis will add a firewall rule to the NIC.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.nic_idyesstringThe ID of the NIC.firewall_ruleyesobjectAFirewallRule objectdescribing the firewall rule to be created.Create theFirewallRuleresource object:fwrule = FirewallRule(
    name='Allow SSH',
    protocol='TCP',
    source_mac='01:23:45:67:89:00',
    port_range_start=22,
    port_range_end=22)Pass the object and arguments tocreate_firewall_rule:response = client.create_firewall_rule(
    datacenter_id='UUID',
    loadbalancer_id='UUID',
    nic_id='UUID',
    firewall_rule=fwrule)Firewall Rule Resource ObjectNameRequiredTypeDescriptionnamenostringThe name of the firewall rule.protocolyesstringThe protocol for the rule: TCP, UDP, ICMP, ANY.source_macnostringOnly traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Anullvalue allows all source MAC address.source_ipnostringOnly traffic originating from the respective IPv4 address is allowed. Anullvalue allows all source IPs.target_ipnostringIn case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Anullvalue allows all target IPs.port_range_startnostringDefines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leaveport_range_startandport_range_endvalue asnullto allow all ports.port_range_endnostringDefines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leaveport_range_startandport_range_endvalue asnullto allow all ports.icmp_typenostringDefines the allowed type (from 0 to 254) if the protocol ICMP is chosen. Anullvalue allows all types.icmp_codenostringDefines the allowed code (from 0 to 254) if protocol ICMP is chosen. Anullvalue allows all codes.Update a Firewall RulePerform updates to an existing firewall rule. You will notice that some arguments, such asprotocolcannot be updated. If theprotocolneeds to be changed, you candeletethe firewall rule and thencreatenew one to replace it.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.nic_idyesstringThe ID of the NIC.firewall_rule_idyesstringThe ID of the firewall rule.namenostringThe name of the firewall rule.source_macnostringOnly traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Anullvalue allows all source MAC address.source_ipnostringOnly traffic originating from the respective IPv4 address is allowed. Anullvalue allows all source IPs.target_ipnostringIn case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Anullvalue allows all target IPs.port_range_startnostringDefines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leaveport_range_startandport_range_endvalue asnullto allow all ports.port_range_endnostringDefines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leaveport_range_startandport_range_endvalue asnullto allow all ports.icmp_typenostringDefines the allowed type (from 0 to 254) if the protocol ICMP is chosen. Anullvalue allows all types.icmp_codenostringDefines the allowed code (from 0 to 254) if protocol ICMP is chosen. Anullvalue allows all codes.Pass the arguments toupdate_firewall_rule:response = client.update_firewall_rule(
    datacenter_id='UUID',
    loadbalancer_id='UUID',
    nic_id='UUID',
    firewall_rule_id='UUID',
    name="Updated Name")Delete a Firewall RuleRemoves a firewall rule.NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.server_idyesstringThe ID of the server.nic_idyesstringThe ID of the NIC.firewall_rule_idyesstringThe ID of the firewall rule.Pass the arguments todelete_firewall_rule:response = client.delete_firewall_rule(
    datacenter_id='UUID',
    server_id='UUID',
    nic_id='UUID',
    firewall_rule_id='UUID')Load BalancersList Load BalancersRetrieve a list of load balancers within the data center.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Pass the arguments tolist_loadbalancers:response = client.list_loadbalancers(datacenter_id='UUID')Get a Load BalancerRetrieves the attributes of a given load balancer.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.loadbalancer_idyesstringThe ID of the load balancer.Pass the arguments toget_loadbalancer:response = client.get_loadbalancer(
    datacenter_id='UUID',
    loadbalancer_id='UUID')Create a Load BalancerCreates a load balancer within the VDC. Load balancers can be used for public or private IP traffic.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.loadbalanceryesobjectALoadBalancer objectdescribing the load balancer to be created.Create theLoadBalancerresource object:loadbalancer = LoadBalancer(
    name='Load Balancer Name',
    dhcp=True)Pass the object and arguments tocreate_loadbalancer:response = client.create_loadbalancer(
    datacenter_id='UUID',
    loadbalancer=loadbalancer)Load Balancer Resource ObjectNameRequiredTypeDescriptionnameyesstringThe name of the load balancer.ipnostringIPv4 address of the load balancer. All attached NICs will inherit this IP.dhcpnoboolIndicates if the load balancer will reserve an IP using DHCP.balancednicsnolistList of NIC IDs taking part in load-balancing. All balanced NICs inherit the IP of the load balancer.Update a Load BalancerPerform updates to attributes of a load balancer.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.namenostringThe name of the load balancer.ipnostringThe IP of the load balancer.dhcpnoboolIndicates if the load balancer will reserve an IP using DHCP.Pass the arguments toupdate_loadbalancer:response = client.update_loadbalancer(
    datacenter_id='UUID',
    loadbalancer_id='UUID',
    name="New Name")Delete a Load BalancerDeletes the specified load balancer.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.load_balancer_idyesstringThe ID of the load balancer.Pass the arguments todelete_loadbalancer:response = client.delete_loadbalancer(
    datacenter_id='UUID',
    loadbalancer_id='UUID')List Load Balanced NICsThis will retrieve a list of NICs associated with the load balancer.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.loadbalancer_idyesstringThe ID of the load balancer.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Pass the arguments toget_loadbalancer_members:response = client.get_loadbalancer_members(
    datacenter_id='UUID',
    loadbalancer_id='UUID')Get a Load Balanced NICRetrieves the attributes of a given load balanced NIC.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.loadbalancer_idyesstringThe ID of the load balancer.nic_idyesstringThe ID of the NIC.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Pass the arguments toget_loadbalanced_nic:response = client.get_loadbalanced_nic(
    datacenter_id='UUID',
    loadbalancer_id='UUID',
    nic_id='UUID')Associate NIC to a Load BalancerThis will associate a NIC to a load balancer, enabling the NIC to participate in load-balancing.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.loadbalancer_idyesstringThe ID of the load balancer.nic_idyesstringThe ID of the NIC.Pass the arguments toadd_loadbalanced_nics:response = client.add_loadbalanced_nics(
    datacenter_id='UUID',
    loadbalancer_id='UUID',
    nic_id='UUID')Remove a NIC AssociationRemoves the association of a NIC with a load balancer.The following table describes the request arguments:NameRequiredTypeDescriptiondatacenter_idyesstringThe ID of the VDC.loadbalancer_idyesstringThe ID of the load balancer.nic_idyesstringThe ID of the NIC you are removing from the load balancer.Pass the arguments toremove_loadbalanced_nic:response = client.remove_loadbalanced_nic(
    datacenter_id='UUID',
    loadbalancer_id='UUID',
    nic_id='UUID')User ManagementList GroupsRetrieves a list of all groups.NameRequiredTypeDescriptiondepthnointAn integer value of 0 - 5 that affects the amount of detail returned.response = client.list_groups()Get a GroupRetrieves the attributes of a given group.The following table describes the request arguments:NameRequiredTypeDescriptiongroup_idyesstringThe ID of the group.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.response = client.get_group(group_id='UUID')Create a GroupCreates a new group and set group privileges.The following table describes the request arguments:NameRequiredTypeDescriptionnameyesstringThe ID of the group.create_datacenternoboolIndicates if the group is allowed to create virtual data centers.create_snapshotnoboolIndicates if the group is allowed to create snapshots.reserve_ipnoboolIndicates if the group is allowed to reserve IP addresses.access_activity_lognoboolIndicates if the group is allowed to access activity log.group = Group(
    name='my-group',
    create_datacenter=True,
    create_snapshot=False,
    reserve_ip=True,
    access_activity_log=False)

response = client.create_group(group)Update a GroupUpdates a group's name or privileges.The following table describes the request arguments:NameRequiredTypeDescriptiongroup_idyesstringThe ID of the group.nameyesstringThe ID of the group.create_datacenternoboolIndicates if the group is allowed to create virtual data centers.create_snapshotnoboolIndicates if the group is allowed to create snapshots.reserve_ipnoboolIndicates if the group is allowed to reserve IP addresses.access_activity_lognoboolIndicates if the group is allowed to access activity log.response = client.update_group(
    group_id='UUID',
    name='my-group',
    create_datacenter=False,
    create_snapshot=True,
    reserve_ip=False,
    access_activity_log=True)Delete a GroupDeletes the specified group.The following table describes the request arguments:NameRequiredTypeDescriptiongroup_idyesstringThe ID of the group.response = client.delete_group(group_id='UUID')List SharesRetrieves a list of all shares though a group.NameRequiredTypeDescriptiongroup_idyesstringThe ID of the group.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.response = client.list_shares(group_id='UUID')Get a ShareRetrieves a specific resource share available to a group.The following table describes the request arguments:NameRequiredTypeDescriptiongroup_idyesstringThe ID of the group.resource_idyesstringThe ID of the resource.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.response = client.get_share(
    group_id='UUID',
    resource_id='UUID')Add a ShareShares a resource through a group.The following table describes the request arguments:NameRequiredTypeDescriptiongroup_idyesstringThe ID of the group.resource_idyesstringThe ID of the resource.edit_privilegenostringIndicates that the group has permission to edit privileges on the resource.share_privilegenostringIndicates that the group has permission to share the resource.response = client.add_share(
    group_id='UUID',
    resource_id='UUID',
    edit_privilege=True,
    share_privilege=True)Update a ShareUpdates the permissions of a group for a resource share.The following table describes the request arguments:NameRequiredTypeDescriptiongroup_idyesstringThe ID of the group.resource_idyesstringThe ID of the resource.edit_privilegenostringIndicates that the group has permission to edit privileges on the resource.share_privilegenostringIndicates that the group has permission to share the resource.response = client.update_share(
    group_id='UUID',
    resource_id='UUID',
    edit_privilege=True,
    share_privilege=True)Delete a ShareRemoves a resource share from a group.NameRequiredTypeDescriptiongroup_idyesstringThe ID of the group.resource_idyesstringThe ID of the resource.response = client.delete_share(
    group_id='UUID',
    resource_id='UUID')List UsersRetrieves a list of all users.NameRequiredTypeDescriptiondepthnointAn integer value of 0 - 5 that affects the amount of detail returned.response = client.list_users()Get a UserRetrieves a single user.NameRequiredTypeDescriptionuser_idyesstringThe ID of the user.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.response = client.get_user(user_id='UUID')Create a UserCreates a new user.The following table describes the request arguments:NameRequiredTypeDescriptionfirstnameyesstringA name for the user.lastnameyesboolA name for the user.emailyesboolAn e-mail address for the user.passwordyesboolA password for the user.administratornoboolAssigns the user have administrative rights.force_sec_authnoboolIndicates if secure (two-factor) authentication should be forced for the user.user = User(
    firstname='John',
    lastname='Doe',
    email='no-reply@example.com',
    password='secretpassword123',
    administrator=True,
    force_sec_auth=False)

response = client.create_user(user)Update a UserUpdates an existing user.The following table describes the request arguments:NameRequiredTypeDescriptionuser_idyesstringThe ID of the user.firstnameyesstringA name for the user.lastnameyesboolA name for the user.emailyesboolAn e-mail address for the user.administratoryesboolAssigns the user have administrative rights.force_sec_authyesboolIndicates if secure (two-factor) authentication should be forced for the user.response = client.update_user(
    user_id='UUID',
    firstname='John',
    lastname='Doe',
    email='no-reply@example.com',
    administrator=True,
    force_sec_auth=False)Delete a UserRemoves a user.NameRequiredTypeDescriptionuser_idyesstringThe ID of the user.response = client.delete_user(user_id='UUID')List Users in a GroupRetrieves a list of all users that are members of a particular group.NameRequiredTypeDescriptiongroup_idyesstringThe ID of the group.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.response = client.list_group_users(group_id='UUID')Add User to GroupAdds an existing user to a group.The following table describes the request arguments:NameRequiredTypeDescriptiongroup_idyesstringThe ID of the group.user_idyesstringThe ID of the user.response = client.add_group_user(
    group_id='UUID',
    user_id='UUID')Remove User from a GroupRemoves a user from a group.NameRequiredTypeDescriptiongroup_idyesstringThe ID of the group.user_idyesstringThe ID of the user.response = client.remove_group_user(
    group_id='UUID',
    user_id='UUID')List ResourcesRetrieves a list of all resources. Alternatively, Retrieves all resources of a particular type.The following table describes the request arguments:NameRequiredTypeDescriptionresource_typenostringThe resource type:datacenter,image,snapshotoripblock.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.response = client.list_resources()

response = client.list_resources(resource_type='snapshot')Get a ResourceRetrieves a single resource of a particular type.The following table describes the request arguments:NameRequiredTypeDescriptionresource_typeyesstringThe resource type:datacenter,image,snapshotoripblock.resource_idyesstringThe ID of the resource.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.response = client.get_resource(resource_id='UUID')

response = client.get_resource(
    resource_type='datacenter',
    resource_id='UUID')Contract ResourcesList Contract ResourcesRetrieves information about the resource limits for a particular contract and the current resource usage.NameRequiredTypeDescriptiondepthnointAn integer value of 0 - 5 that affects the amount of detail returned.response = client.list_contracts()RequestsEach call to the IonosEnterprise API is assigned a request ID. These operations can be used to get information about the requests that have been submitted and their current status.List RequestsRetrieve a list of requests.NameRequiredTypeDescriptiondepthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Pass the arguments tolist_requests:response = client.list_requests()Get a RequestRetrieves the attributes of a specific request. This operation shares the sameget_requestmethod used for getting request status, however the response it determined by the boolean value you pass forstatus. To get details about the request itself, you want to pass astatusofFalse.The following table describes the request arguments:NameRequiredTypeDescriptionrequest_idyesstringThe ID of the request.statusyesboolSet toFalseto have the request details returned.Pass the arguments toget_request:response = client.get_request(
    request_id='UUID',
    status=False)Get a Request StatusRetrieves the status of a request. This operation shares the sameget_requestmethod used for getting the details of a request, however the response it determined by the boolean value you pass forstatus. To get the request status, you want to pass astatusofTrue.The following table describes the request arguments:NameRequiredTypeDescriptionrequest_idyesstringThe ID of the request.statusyesboolSet toTrueto have the status of the request returned.Pass the arguments toget_request:response = client.get_request(
    request_id='UUID',
    status=True)KubernetesList Kubernetes ClustersRetrieve the list of Kubernetes clusters.The following table describes the request arguments:NameRequiredTypeDescriptiondepthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.response = client.list_k8s_clusters()Create a Kubernetes ClusterThis will create a new Kubernetes Cluster.The following table describes the request arguments:NameRequiredTypeDescriptionnameyesstringThe Kubernetes Cluster Name.Create the Kubernetes Cluster:my_cluster=client.create_k8s_cluster(cluster_name)Wait for the cluster to be active:client.wait_for(fn_request=lambda:client.list_k8s_clusters(),fn_check=lambdar:list(filter(lambdae:e['properties']['name']==cluster_name,r['items']))[0]['metadata']['state']=='ACTIVE',console_print='.',scaleup=10000)Retrieve a Kubernetes ClusterThis will retrieve a Kubernetes Cluster.The following table describes the request arguments:NameRequiredTypeDescriptionk8s_cluster_idyesstringThe ID of the Kubernetes Cluster.Retrieve the Kubernetes Cluster:client.get_k8s_cluster(my_cluster['id'])Delete a Kubernetes ClusterThis will delete a Kubernetes Cluster.The following table describes the request arguments:NameRequiredTypeDescriptionk8s_cluster_idyesstringThe ID of the Kubernetes Cluster.Delete the Kubernetes Cluster:client.delete_k8s_cluster(my_cluster['id'])Retrieve a Kubernetes Cluster KubeConfigThis will retrieve the KubeConfig for a Kubernetes Cluster.The following table describes the request arguments:NameRequiredTypeDescriptionk8s_cluster_idyesstringThe ID of the Kubernetes Cluster.Retrieve the Kubeconfig for a Kubernetes Cluster:client.get_k8s_config(my_cluster['id'])List Kubernetes NodePoolsRetrieve the list of nodepools for a Kubernetes cluster.The following table describes the request arguments:NameRequiredTypeDescriptionk8s_cluster_idyesstringThe ID of the Kubernetes Cluster.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.response = client.list_k8s_cluster_nodepools(k8s_cluster_id)Create a NodePool for a Kubernetes ClusterThis will create a new NodePool for a Kubernetes Cluster.The following table describes the request arguments:NameRequiredTypeDescriptionk8s_cluster_idyesstringThe ID of the Kubernetes ClusternameyesstringThe NodePool Namedatacenter_idyesstringThe ID of the Datacenter to place the NodePool innode_countyesintNumber of nodes part of the Node Poolcpu_familyyesstringA valid cpu family namecores_countyesintNumber of cores for noderam_sizeyesintRAM size for node, minimum size 2048MB is recommendedavailability_zoneyesstringThe availability zone in which the server should existstorage_typeyesstringHardware type of the volumestorage_sizeyesintThe size of the volume in GB. The size should be greater than 10GBk8s_versionnostringThe kubernetes version in which a cluster is running. This imposes restrictions on what kubernetes versions can be run in a cluster's nodepoolsmaintenance_windownoobjectThe time to use for a maintenance window. Accepted formats are: HH:mm:ss; HH:mm:ss"Z"; HH:mm:ssZ. This time may varies by 15 minutes.auto_scalingnoobjectThe minimum number of worker nodes that the managed node group can scale in.lan_idsnoList of intsArray of additional LANs attached to worker nodeslabelsnodictMap of labels attached to node poolannotationsnodictMap of annotations attached to node poolpublic_ipsnolistList of IP addresses to be used by nodesMethod signature:defcreate_k8s_cluster_nodepool(self,k8s_cluster_id,name,datacenter_id,node_count,cpu_family,cores_count,ram_size,availability_zone,storage_type,storage_size,k8s_version=None,maintenance_window=None,auto_scaling=None,lan_ids=None,labels=None,annotations=None):Create the NodePool:my_nodepool=client.create_k8s_cluster_nodepool('6840d5d8-9c97-4236-9957-eacf8c197db8','NEW_1_INTEL_XEON_123','6887cc8b-2c17-49cf-bd7f-db831b74f1d5',2,'INTEL_XEON',1,2048,'AUTO','HDD',11,k8s_version='1.17.8',maintenance_window={'dayOfTheWeek':"Monday",'time':'17:00:00'},auto_scaling={'minNodeCount':2,'maxNodeCount':3},lan_ids=[],labels={'lu1':'vu1','lu2':'vu2'},annotations={'au1':'vau1','au2':'vau2'})Wait for the nodepool to be active:client.wait_for(fn_request=lambda:client.list_k8s_cluster_nodepools(my_cluster['id']),fn_check=lambdar:list(filter(lambdae:e['properties']['name']==pool_name,r['items']))[0]['metadata']['state']=='ACTIVE',console_print='.',scaleup=10000)Retrieve a NodePoolThis will retrieve a NodePool.The following table describes the request arguments:NameRequiredTypeDescriptionk8s_cluster_idyesstringThe ID of the Kubernetes Cluster.nodepool_idyesstringThe ID of the NodePool.Retrieve the NodePool:client.get_k8s_cluster_nodepool(my_cluster['id'],my_nodepool['id'])Delete a NodePoolThis will delete a NodePool.The following table describes the request arguments:NameRequiredTypeDescriptionk8s_cluster_idyesstringThe ID of the Kubernetes Cluster.nodepool_idyesstringThe ID of the NodePool.Delete the NodePool:client.delete_k8s_cluster_nodepool(my_cluster['id'],my_nodepool['id'])Update a NodePoolThis will update a nodepool.The following table describes the request arguments:NameRequiredTypeDescriptionk8s_cluster_idyesstringThe unique ID of the Kubernetes Clusternodepool_idyesstringThe unique ID of the Kubernetes Node Poolnode_countyesintNumber of nodes part of the Node Poolmaintenance_windownodictThe time to use for a maintenance window. Accepted formats are: HH:mm:ss; HH:mm:ss"Z"; HH:mm:ssZ. This time may varies by 15 minutes.auto_scalingnodictThe minimum number of worker nodes that the managed node group can scale in.lan_idsnoList of intsArray of additional LANs attached to worker nodespublic_ipsnolistList of IP addresses to be used by nodesMethod signature:defupdate_k8s_cluster_nodepool(self,k8s_cluster_id,nodepool_id,node_count,maintenance_window=None,auto_scaling=None,lan_ids=None):Update a nodepool:client.update_k8s_cluster_nodepool('6840d5d8-9c97-4236-9957-eacf8c197db8','8fce6f2c-8fed-4fa2-b577-4ee6ab7e8359',2,maintenance_window={'dayOfTheWeek':"Monday",'time':'17:00:00'},auto_scaling={'minNodeCount':2,'maxNodeCount':3},lan_ids=[2,3])Private Cross ConnectsList Private Cross-ConnectsRetrieve the list of Private Cross-Connects.The following table describes the request arguments:NameRequiredTypeDescriptiondepthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.response=client.list_pccs()Create a Private Cross-ConnectThis will create a new Private Cross-Connect.The following table describes the request arguments:NameRequiredTypeDescriptionpccyesstringThe Private Cross-Connect object.Create the Private Cross-Connect:pcc=PCC(name="PCC NAME",description="PCC DESCRIPTION")my_cluster=client.create_pcc(pcc)Retrieve a private cross-connectThis will retrieve a private cross-connect.The following table describes the request arguments:NameRequiredTypeDescriptionpcc_idyesstringThe ID of the pcc.depthnointAn integer value of 0 - 5 that affects the amount of detail returned.Retrieve the private cross-connect:client.get_pcc(my_pcc['id'])Delete a private cross-connectThis will delete a private cross-connect.The following table describes the request arguments:NameRequiredTypeDescriptionpcc_idyesstringThe ID of the private cross-connect.Delete the private cross-connect:client.delete_pcc(my_pcc['id'])Update a private cross-connectThis will update a private cross-connect.The following table describes the request arguments:NameRequiredTypeDescriptionpcc_idyesstringThe ID of the Kubernetes ClusternamenostringThe name of the private cross-connectdescriptionnostringThe description of the private cross-connectUpdate a private cross-connect:client.update_pcc(my_pcc['id'],name='new name',description='new description')S3 KeysList S3 KeysRetrieve the list of S3 Keys.The following table describes the request arguments:NameRequiredTypeDescriptionuser_idyesstringdepthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.s3keys=client.list_s3keys('user_id')Create a S3 KeyCreate a S3 key for the given user.The following table describes the request arguments:NameRequiredTypeDescriptionuser_idyesstringuser id.Create the S3 key:my_s3key=client.create_s3key('user_id')Get S3 keyRetrieve given S3 key belonging to the given User.The following table describes the request arguments:NameRequiredTypeDescriptionuser_idyesstringThe user ID.key_idyesstringThe key ID.depthnointegerAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Retrieve the S3 key:s3key=client.get_s3key('user_id','key_id')Update a S3 keyModify a S3 key having the given key id.The following table describes the request arguments:NameRequiredTypeDescriptionuser_idyesstringThe unique ID of the userkey_idyesstringThe ID of the key.activenobooleanState of the Key.Update S3 key:update_s3key(user_id,key_id,active=False)Delete a S3 keyThis will delete a S3 Key.The following table describes the request arguments:NameRequiredTypeDescriptionuser_idyesintegerThe ID of the user.key_idyesintegerThe ID of the key.Delete S3 key:client.delete_s3key('user_id','key_id')Get S3 sso urlThis will retrieve the sso url.The following table describes the request arguments:NameRequiredTypeDescriptionuser_idyesstringThe unique ID of the user.depthnointegerAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Retrieve the sso url:s3ssourl=client.get_s3ssourl('user_id')Backup UnitsList backup unitsRetrieve the list of Backup Units.The following table describes the request arguments:NameRequiredTypeDescriptiondepthnointAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.response=client.list_backupunits()Create a Backup UnitThis will create a new Backup Unit.The following table describes the request arguments:NameRequiredTypeDescriptionbackupunityesBackupunitThe backupunit object.Create the backupunit:The following table describes Backup unit arguments:NameRequiredTypeDescriptionnameyesstringA name of that resource (only alphanumeric characters are acceptable)passwordyesstringThe password associated to that resource.emailyesstringThe email associated with the backup unit. Bear in mind that this email does not be the same email as of the user.backupunit=Backupunit(name='bkp_name',password='bkp_pass',email='test@email.com')backupunit=client.create_backupunit(backupunit)Get a backup unitThis will retrieve a backup unit.The following table describes the request arguments:NameRequiredTypeDescriptionbackupunit_idyesstringId of the backup unit.Retrieve the backup unit:backupunit=client.get_backupunit(my_backupunit['id'])Update a Backup UnitModify a Backup UnitThe following table describes the request arguments:NameRequiredTypeDescriptionbackupunit_idyesstringThe ID of the backupunit.namenostringA name of that resource (only alphanumeric characters are acceptable).passwordnostringThe password associated to that resourceemailnostringThe email associated with the backup unit. Bear in mind that this email does not be the same email as of the user.Update a Backup Unit.client.update_backupunit(backupunit_id,name='new name',password='new password',email='test@email.com')Delete a Backup UnitThis will delete a Backup Unit.The following table describes the request arguments:NameRequiredTypeDescriptionbackupunit_idyesstringThe ID of the Backupunit.Delete the Backup Unit:client.delete_backupunit(my_backupunit['id'])Get SSO UrlThis will get SSO Url.The following table describes the request arguments:NameRequiredTypeDescriptionbackupunit_idyesstringThe ID of the backupunit.depthnointegerAn integer value of 0 - 5 that affects the amount of detail returned.  See theDepthsection.Get SSO Url:ssourl=client.get_ssourl(my_backupunit['id'])ExamplesBelow are some examples using the SDK for Python. These examples will assume credentials are being set with environment variables:export IONOS_USERNAME=username
export IONOS_PASSWORD=passwordList All Data CentersThis simple example will list all data centers under an account.#!/usr/bin/python

import json
import os

from ionosenterprise.client import IonosEnterpriseService

# Instatiate IonosEnterprise connection
client = IonosEnterpriseService(
    username=os.getenv('IONOS_USERNAME'),
    password=os.getenv('IONOS_PASSWORD'))

# List data centers
datacenters = client.list_datacenters()
print json.dumps(datacenters, indent=4)Search for ImagesThe following example will provide a method for retrieving a list of images based on a partial case-insensitive name and location match.#!/usr/bin/python

import os

from ionosenterprise.client import IonosEnterpriseService


def find_image(conn, name, location):
    '''
    Find image by partial name and location
    '''
    images = []
    for item in conn.list_images()['items']:
        if (item['properties']['location'] == location and
           item['properties']['imageType'] == 'HDD' and
           name.lower() in item['properties']['name'].lower()):
            images.append(item)
    return images

# Instantiate IonosEnterprise connection
client = IonosEnterpriseService(
    username=os.getenv('IONOS_USERNAME'),
    password=os.getenv('IONOS_PASSWORD'))

# Search criteria based on partial case-insensitive name and location
name = 'Ubuntu'
location = 'de/fkb'

# Find images based on above search criteria
for image in find_image(client, name, location):
    print "{0}\t{1}\t{2}".format(
        image['id'],
        image['properties']['name'],
        image['properties']['location'])Reserve an IP BlockHere we will reserve a public IP block.#!/usr/bin/python

import json
import os

from ionosenterprise.client import IonosEnterpriseService, IPBlock


# Instatiate IonosEnterprise connection
client = IonosEnterpriseService(
    username=os.getenv('IONOS_USERNAME'),
    password=os.getenv('IONOS_PASSWORD'))

ipblock = IPBlock(location='us/las', size=5)

response = client.reserve_ipblock(ipblock)

print json.dumps(response, indent=4)Wait for ResourcesThe remaining examples will require dependent resources. A volume cannot be attached to a server before the server and volume are finished provisioning. Therefore, we require thewait_for_completionmethod that will stop and wait for the server and volume to finish provisioning before attaching the volume to the server.Component BuildIonosEnterprise allows servers to be built by their individual components. That is, by connecting customized components such as servers, volumes, and NICs together. For example, a server can be provisioned in one request followed by one or more NICs and volumes in following requests. The volumes can then be attached separately to the server.It is important to note that you will need to wait for each individual component to finish provisioning before it can be used in subsequent operations. This behavior is demonstrated below.#!/usr/bin/python

import json
import os

from ionosenterprise.client import IonosEnterpriseService
from ionosenterprise.client import (
    Datacenter, LAN, Server, NIC, Volume, FirewallRule)

client = IonosEnterpriseService(
    username=os.getenv('IONOS_USERNAME'),
    password=os.getenv('IONOS_PASSWORD'))

timeout = 1800

# Create data center
datacenter = Datacenter(
    name='Python SDK Data Center',
    description='Python SDK data center',
    location='us/las')

response = client.create_datacenter(datacenter=datacenter)
client.wait_for_completion(response, timeout)
datacenter_id = response['id']

# Create public LAN
lan = LAN(name="Public LAN", public=True)

response = client.create_lan(datacenter_id, lan=lan)
client.wait_for_completion(response, timeout)
lan_id = response['id']

# Create server
server = Server(
    name='Python SDK Server',
    ram=4096,
    cores=4,
    cpu_family='INTEL_XEON')

response = client.create_server(datacenter_id=datacenter_id, server=server)
client.wait_for_completion(response, timeout)
server_id = response['id']

# Create public NIC
nic = NIC(
    name='Public NIC',
    dhcp=True,
    lan=lan_id,
    firewall_active=True,
    nat=False)

response = client.create_nic(
    datacenter_id=datacenter_id,
    server_id=server_id,
    nic=nic)
client.wait_for_completion(response, timeout)
nic_id = response['id']

# Create firwall rule
fwrule = FirewallRule(
    name='Allow SSH',
    protocol='TCP',
    source_ip='0.0.0.0',
    port_range_start=22,
    port_range_end=22,
    icmp_type=None)

response = client.create_firewall_rule(
    datacenter_id=datacenter_id,
    server_id=server_id,
    nic_id=nic_id,
    firewall_rule=fwrule)
client.wait_for_completion(response, timeout)

# Create system volume
volume1 = Volume(
    name='System Volume',
    size=20,
    image='0d4f97f0-1689-11e7-97ce-525400f64d8d',
    bus='VIRTIO',
    type='HDD',
    ssh_keys=['ssh-rsa AAAAB3NzaC1yc2EAAAADAQ...'],
    image_password='s3cr3tpass0rd',
    availability_zone='ZONE_3')

response = client.create_volume(
    datacenter_id=datacenter_id,
    volume=volume1)
client.wait_for_completion(response, timeout)
volume1_id = response['id']

# Attach system volume
response = client.attach_volume(
    datacenter_id=datacenter_id,
    server_id=server_id,
    volume_id=volume1_id)
client.wait_for_completion(response, timeout)

# Create data volume
volume2 = Volume(
    name='Data Volume',
    size=100,
    type='SSD',
    bus='VIRTIO',
    license_type='OTHER')

response = client.create_volume(
    datacenter_id=datacenter_id,
    volume=volume2)
client.wait_for_completion(response, timeout)
volume2_id = response['id']

# Attach data volume
response = client.attach_volume(
    datacenter_id=datacenter_id,
    server_id=server_id,
    volume_id=volume2_id)
client.wait_for_completion(response, timeout)

live_datacenter = client.get_datacenter(datacenter_id=datacenter_id, depth=5)
print json.dumps(live_datacenter, indent=4)Composite BuildThe IonosEnterprise platform also allows fully operational servers to be provisioned with a single request. This is accomplished by nesting related resources.Multiple servers, volumes, LANs, and load balancers can be nested under a data center, multiple NICs and volumes can be nested under servers, and firewall rules under NICs.This example will demonstrate composite resources.#!/usr/bin/python

import json
import os

from ionosenterprise.client import IonosEnterpriseService
from ionosenterprise.client import Datacenter, Server, NIC, Volume, FirewallRule

# Instatiate IonosEnterprise connection
client = IonosEnterpriseService(
    username=os.getenv('IONOS_USERNAME'),
    password=os.getenv('IONOS_PASSWORD'))

# Define a firewall rule
fwrule1 = FirewallRule(
    name='Allow SSH',
    protocol='TCP',
    source_ip='0.0.0.0',
    port_range_start=22,
    port_range_end=22,
    icmp_type=None)

# Define a public NIC
nic1 = NIC(
    name='Public NIC',
    dhcp=True,
    lan=1,
    firewall_active=True,
    firewall_rules=[fwrule1],
    nat=False)

# Define a private NIC
nic2 = NIC(
    name='Private NIC',
    dhcp=True,
    lan=2)

# Define a system volume
volume1 = Volume(
    name='System Volume',
    size=20,
    image='0d4f97f0-1689-11e7-97ce-525400f64d8d',
    bus='VIRTIO',
    type='HDD',
    ssh_keys=['ssh-rsa AAAAB3NzaC1yc2EAAAADAQ...'],
    image_password='s3cr3tpass0rd',
    availability_zone='ZONE_3')

# Define a data volume
volume2 = Volume(
    name='Data Volume',
    size=100,
    type='SSD',
    bus='VIRTIO',
    licence_type='OTHER')

# Define a server with associated NICs and volumes
server = Server(
    name='Python SDK Server',
    ram=4096,
    cores=4,
    cpu_family='INTEL_XEON',
    nics=[nic1, nic2],
    create_volumes=[volume1, volume2])

# Define a data center with the server
datacenter = Datacenter(
    name='Python SDK Data Center',
    description='Python SDK data center',
    location='us/las',
    servers=[server])

# Initiate the data center and nested resource provisioning
response = client.create_datacenter(datacenter)

# Wait for the data center and nested resources to finish provisioning
client.wait_for_completion(response)

datacenter_id = response['id']

# Set the first LAN to public
response = client.update_lan(
    datacenter_id=datacenter_id,
    lan_id=1,
    name='Public LAN',
    public=True)

client.wait_for_completion(response)

# Print the data center properties and nested resources
response = client.get_datacenter(datacenter_id=datacenter_id, depth=5)
print json.dumps(response, indent=4)SupportYou can find additional examples in the repositoryexamplesdirectory. If you find any issues, please let us know via theDevOps Central communityorGitHub's issue systemand we'll check it out.TestingYou can find a full list of tests inside thetestsfolder. To run all available tests:export IONOS_USERNAME=username
export IONOS_PASSWORD=password

pip install -r requirements.txt
python -m unittest discover testsTo run a single test:python -m unittest discover tests test_datacenter.pyContributingFork it (https://github.com/ionos-enterprise/ionos-enterprise-sdk-python/fork)Create your feature branch (git checkout -b my-new-feature)Commit your changes (git commit -am 'Add some feature')Push to the branch (git push origin my-new-feature)Create a new Pull Request