Pod Methods¶
-
class
netlab.api.
PodApiMixin
¶ -
pod_acl_add
(*, com_id, pod_id, acc_id=None, cls_id=None, team=None, **kwargs)¶ This method allows you to add access controls to a pod on the NETLAB+ system.
-
pod_acl_admin_add
(*, acc_id, pod_id, **kwargs)¶ This method allows you add additional pod access control administrators.
-
pod_acl_admin_auth
(*, acc_id, pod_id, **kwargs)¶ This method returns true if a specified instructor account is authorized to manage POD ACLs on a specified pod.
-
pod_acl_admin_list
(*, pod_id, **kwargs)¶ This method allows you to retrieve a list of pod access controls per pod.
-
pod_acl_admin_pods
(*, acc_id, **kwargs)¶ This method allows you to retrieve a list of pods a user has access to.
- Parameters
acc_id (int) – Account identifier.
- Returns
list
-
pod_acl_admin_remove
(*, acc_id, pod_id, **kwargs)¶ This method allows you to remove authorization for an account.
-
pod_acl_challenge
(*, com_id, pod_id, acc_id=None, cls_id=None, team=None, **kwargs)¶ This method allows you to test against a pod access control list.
-
pod_acl_get
(*, pacl_uuid, **kwargs)¶ This method allows you to retrieve a pod access control list.
-
pod_acl_list
(*, pod_id, **kwargs)¶ This method allows you to retrieve a list of pod access controls per pod.
-
pod_acl_remove
(*, pacl_uuid, **kwargs)¶ This method allows you to remove a pod access control list.
- Parameters
pacl_uuid (int) – Pod access control list UUID.
- Returns
Pod was successfully removed.
- Return type
‘OK’
-
pod_add
(*, pod_id, pt_id, devices=None, pod_acl_enabled=False, pod_adv_settings=None, pod_auto_net_enabled=True, pod_auto_net_host_setup=True, pod_auto_net_host_teardown=True, pod_cat=<PodCategory.PERSISTENT_VM: 'PV'>, pod_desc=None, pod_name=None, **kwargs)¶ This method allows you to add a pod to the NETLAB+ system. Pods created will be OFFLINE after added.
- Parameters
pod_id (int) – Unique pod identifier.
pt_id (str) – Pod type identifier.
devices (list) – Array of devices associated with this pod. This is for real equipment pods only.
pod_acl_enabled (bool) – Pod access control list enabled.
pod_adv_settings (str) – Advanced settings for pod configuration.
pod_auto_net_enabled (bool) – Auto-networking enabled.
pod_auto_net_host_setup (bool) – Auto-networking host setup enabled.
pod_auto_net_host_teardown (bool) – Auto-networking host teardown enabled.
pod_cat (PodCategory) – Pod category type.
pod_desc (str) – Pod description.
pod_name (str) – Pod name.
- Returns
The addition succeeded.
- Return type
‘OK’
-
pod_clone_task
(*, source_pod_id, clone_pod_id, clone_pod_name, pc_clone_specs=None, severity_level=<HDRSeverity.WARN: 3>, **kwargs)¶ Clone a pod.
- Parameters
source_pod_id (int) – Source pod unique identifier.
clone_pod_id (int) – Cloned pod unique identifier
clone_pod_name (str) – Cloned unique pod name.
pc_clone_specs (list or dict) – Array of PC clone specifications. Any unpassed params will be taken from the existing pods. If a dict is passed, the params will be used on every pod.
severity_level (HDRSeverity) – Display detailed events for the task only at this severity level or higher.
- Returns
HDR result
- Return type
HDRStatus
pc_clone_specs
The format requires a list of dictionaries. One dictionary per each PC in the pod, e.g.
[{pc.clone.spec.1}, {pc.clone.spec.2}]
. The following is a list of the keys, the expected value type and a key description.PC Specs: (Obtained via remote_pc lookup - no need to adjust)
- Pc_type
str : [AVMI, ABSENT]
- Source_snapshot
str : default(vm_snapshot)
- Clone_snapshot
str : default(vm_snapshot)
- Clone_type
str : default(LINKED) [LINKED, FULL]
- Clone_role
str : default(NORMAL) [MASTER, NORMAL, PERSISTENT]
- Clone_name
str : default({clone_pod_name}_{pc_label})
- Clone_storage_alloc
str : default(ONDEMAND) [ONDEMAND, PREALLOCATED]
- Clone_datastore
Datastore in which to clone.
- Clone_vh_id
int : RemotePC vh_id
Example:
pc_clone_specs = [{ "clone_role":"NORMAL", "clone_type":"LINKED", "source_snapshot":"GOLDEN_MASTER", "pc_type":"AVMI", "clone_vh_id":1, "clone_name":"Test_Linux_Install_pod04_CentOS Server", "clone_storage_alloc":"ONDEMAND", "clone_datastore":"local", "clone_snapshot":"GOLDEN_MASTER" }, { "clone_role":"NORMAL", "clone_type":"LINKED", "source_snapshot":"GOLDEN_MASTER", "pc_type":"AVMI", "clone_vh_id":1, "clone_name":"Test_Linux_Install_pod04_Ubuntu Workstation", "clone_storage_alloc":"ONDEMAND", "clone_datastore":"local", "clone_snapshot":"GOLDEN_MASTER" }]
-
pod_get
(*, pod_id, properties='default', **kwargs)¶ - Parameters
- Returns
Returns a dictionary object containing the following properties:
- Return type
Properties
- def_im_name
Default image name.
- def_topology_image
Default topology image URL.
- def_vlan_map
Default VLAN mapping.
- device_count
Count of devices in pod type.
- devices
List of devices in pod type.
- pod_acl_enabled
Pod access control list enabled.
- pod_admin_state
Administrative pod states.
- pod_adv_settings
A list of all advanced settings.
- pod_auto_net_enabled
Automatic VM networking enabled.
- pod_auto_net_host_setup
Automatic Host networking setup enabled.
- pod_auto_net_host_teardown
Automatic Host networking teardown enabled.
- pod_cat
Pod category type.
netlab.enums.PodCategory
- pod_csw_base_vlan
Pod control switch base VLAN.
- pod_csw_id
Pod control switch id.
- pod_current_state
Pod current state status.
- pod_desc
Pod description.
- pod_id
Unique pod identifier.
- pod_managed
Pod is managed.
- pod_name
Pod name.
- pod_origin
Pod origin.
- pod_res_id
Current pod reservation identifier.
- pod_task_id
Current pod task identifier.
- pod_task_info
Current pod task information.
- pod_task_type
Current pod task type.
- pod_uuid
Globally unique pod identifier.
- pt_actions
Pod type actions enabled.
- pt_adv_settings
Long string of advanced settings.
- pt_apc_port_count
Switched outlet port count requirement.
- pt_apdid
Author identifier for pod design.
- pt_as_port_count
Access server port count requirement.
- pt_author
Pod design author.
- pt_build
Pod build number.
- pt_copyright
Pod design copyright.
- pt_csw_port_count
Control switch port count requirement.
- pt_desc
Pod type description.
- pt_gpdid
Global unique identifier.
- pt_id
Pod type identifier.
- pt_name
Pod type name.
- pt_notes
Pod type notes.
- pt_org
Pod design organization.
- pt_origin
Pod type origin.
- pt_pod_max
Max pod count of this type.
- pt_removable
Pod type is removable.
- pt_tabs
Pod type tabs enabled.
- pt_url
Pod design support URL.
- pt_vlan_pool
Pod type vlan pool.
- remote_pc
List of remote PCs in pod type with their expanded properties. See Remote PC table below.
- remote_pc_count
Count of remote PCs in pod type.
- reservations
The number of reservations scheduled or in progress for this pod.
- sched_image
Scheduler image URL.
- vm_alloc
VM resource allocation properties. Added in 18.5.0.
-
pod_list
(*, pod_cat=None, **kwargs)¶ List pods on the system.
- Parameters
pod_cat (PodCategory) – Pod category type.
- Returns
Returns a list of dictionary objects containing the following properties:
- Return type
Properties
- def_topology_image
Default topology image URL.
- pod_acl_enabled
Pod access control lists enabled for this pod.
- pod_admin_state
Pod administrative state.
netlab.enums.PodAdminState
- pod_cat
Pod category.
netlab.enums.PodCategory
- pod_current_state
Pod current state.
netlab.enums.PodCurrentState
- pod_desc
Pod description.
- pod_dyn_vlan
Pod is using dynamic vlans.
- pod_id
Unique pod identifier.
- pod_managed
Pod is managed (currently always True).
- pod_name
Pod name.
- pod_uuid
Pod name.
- pod_res_id
Current pod reservation identifier.
- pt_apdid
Author identifier for pod design.
- pt_desc
Pod type description.
- pt_gpdid
Global unique identifier.
- pt_id
Pod type identifier.
- pt_name
Pod type name.
- sched_image
Scheduler image URL.
-
pod_list_used_ids
(**kwargs)¶ List the used pod_id’s on the system.
-
pod_pc_get
(*, pod_id=None, pl_index=None, pc_id=None, **kwargs)¶ Get information regarding a pod pc.
- Parameters
- Returns
On success, returns the following properties:
- Return type
Properties
- pc_icon
Icon identifier.
netlab.enums.PCIcon
- pc_id
Unique pc identifier.
- pc_label
PC label.
- pc_online
PC online.
- pc_origin
PC origin.
- pc_os_id
PC operating system identifier.
- pc_os_name
NETLAB+ operating system name.
- pc_pod_id
pod_id pc is associated to.
- pc_pod_index
Index of pods.
- pc_revert_to_scrub
Revert pc during scrub.
- pc_type
PC type.
netlab.enums.PCType
- pc_vnc_ip_addr
IP Address of vnc (ESXi host) server.
- pc_vnc_port
Port number VNC is running on.
- pc_vnc_use_copy_rect
Always Allow VNC to use copy rect encoding.
- pl_icon
Pod design PC icon identifier.
netlab.enums.PLIcon
- pl_index
PC pod index.
- pl_label
Remote pc label.
- pt_id
Pod type identifier.
- vdc_id
Agent hostname/IP address.
- vdc_name
VM Datacenter name.
- vh_bios_date
Timestamp of BIOS creation date.
- vh_bios_version
BIOS version installed.
- vh_com_path
Virtual host communication path.
netlab.enums.VirtualHostComPath
- vh_cpu_cores
Total count of CPU cores on virtual host.
- vh_cpu_mhz
Speed in MHz of CPU.
- vh_cpu_model
CPU model identification.
- vh_cpu_threads
Number of threads CPUs can handle.
- vh_cpu_threads
Number of threads CPUs can handle.
- vh_date_modified
Timestamp of virtual host information has been modified.
- vh_date_tested
Timestamp of virtual host test communication.
- vh_id
Virtual host identifier.
- vh_inside_ipv4_addr
Inside interface ipv4 address.
- vh_inside_vswitch_0
Virtual host inside vSwitch.
- vh_last_test_status
Status of last virtual host test communication.
- vh_memory_mb
Total RAM in MB of virtual host.
- vh_name
Virtual host hostname.
- vh_online
Virtual host is online.
- vh_os_build
Operating system build number.
- vh_os_description
Operating system description.
- vh_os_name
Operating system name.
- vh_os_type
Operating system type.
- vh_os_vendor
Operating system vendor.
- vh_os_version
Operating system version.
- vh_outside_ipv4_addr
Outside interface ipv4 address.
- vh_pra_enabled
Proactive resource awareness is enabled.
- vh_pra_max_cpu
Max number of CPUs for PRA.
- vh_pra_max_mem_mb
Max amount of RAM in MB for PRA.
- vh_pra_max_vm
Max amount of virtual machines for PRA.
- vh_sys_model
System model.
- vh_sys_service_tag
System service tag.
- vh_sys_vendor
System vendor.
- vh_uuid
Virtual host unique global identifier.
- vhg_id
Virtual host group identifier.
- vm_alloc_cpu_n
Total amount of allocated CPUs.
- vm_alloc_mem_mb
Total amount of allocated RAM.
- vm_auto_display
Virtual machine auto display port configuration.
- vm_auto_network
Virtual machine auto networking.
- vm_auto_settings
Virtual machine auto settings.
- vm_child_count
Total count of children VMs.
- vm_comments
Virtual machine comments from VMX.
- vm_date_added
Timestamp of virtual machine added to NETLAB+ inventory.
- vm_id
Virtual machine identifier.
- vm_name
Virtual machine name.
- vm_netlab_os_id
NETLAB+ match to vm_vendor_os_id.
- vm_parent_id
Virtual machine parent identifier, if VM is a link clone.
- vm_parent_snapname
Virtual machine parent snapshot name, if VM is a link clone.
- vm_path
Virtual machine path on datastore.
- vm_power_state
Virtual machine power state.
- vm_role
Virtual machine role in NETLAB+ inventory.
netlab.enums.VirtualMachineRole
- vm_runtime_vh_id
Unique identifier of runtime virtual host.
- vm_sanity_checks
Sanity checks.
- vm_shutdown_pref
Shutdown preference.
- vm_snapshot
This is what the VM reverts to when the pod is reset. You can take multiple snapshots with the same name, without having to update this field. Update this field with a call to
pod_pc_update()
- vm_uuid
Virtual machine unique identifier.
- vm_vendor_os_id
Vendor operating system identifier.
- vm_vendor_os_name
Vendor operating system name.
-
pod_pc_update
(*, pc_id, pc_type=None, pc_os_id=None, pc_online=None, vm_shutdown_pref=None, vm_id=None, vm_snapshot=None, vm_auto_display=None, vm_auto_network=None, vm_auto_settings=None, vm_sanity_checks=None, **kwargs)¶ Update information regarding a pod pc.
- Parameters
pc_id (int) – unique pc identifier
pc_type (str) – PC type (ABSENT, AVMI)
pc_os_id (str) – PC operating system identifier
pc_online (bool) – PC online
vm_shutdown_pref (str) – Shutdown preference
vm_id (int) – Virtual machine identifier
vm_snapshot (str) – This is what the VM reverts to when the pod is reset. You can take multiple snapshots with the same name, without having to update this field.
vm_auto_display (bool) – Virtual machine auto display port configuration
vm_auto_network (bool) – Virtual machine auto networking
vm_auto_settings (bool) – Virtual machine auto settings
vm_sanity_checks (bool) – Virtual machine sanity checks
- Returns
On success, returns ‘OK’
- Return type
-
pod_remove_task
(*, pod_id, remove_vms=<RemoveVMS.NONE: 'NONE'>, severity_level=<HDRSeverity.WARN: 3>, **kwargs)¶ - Parameters
pod_id (int) – Pod unique identifier.
remove_vms (RemoveVMS) – Specifies the method for removing the virtual machines.
severity_level (HDRSeverity) – Display detailed events for the task only at this severity level or higher.
- Returns
HDR result
- Return type
HDRStatus
-
pod_state_change
(*, pod_id, state, **kwargs)¶ Sets pod state to either ONLINE, OFFLINE or RESUME.
-
pod_types_get
(*, pt_id, properties='default', **kwargs)¶ Returns the build, id and name of installed pods on queried system.
- Parameters
- Returns
Returns all or selected properties from the list initially passed for return.
- Return type
Properties
- pt_id
Pod type identifier.
- pt_name
Account email.
- pt_build
Account Family(Last) name.
- pt_gpdid
Global unique identifer.
- pt_apdid
Short unique identifier.
- pt_desc
Pod type description.
- pt_index
Pod type index.
- pt_type
Pod type id
- sched_image
Location of scheduler image.
- def_topology_image
Location of the default topology image.
- def_im_name
Default image map name.
- def_vlan_map
Default VLAN map.
- pt_tabs
Pod type tabs.
- pt_actions
Pod type actions.
- pt_origin
Pod type origin.
- pt_vlan_pool
Pod type vlan pool.
- pt_pod_max
Max amount of pod types allowed on system.
- pt_notes
Pod type notes.
- pt_csw_port_count
Number of consecutive ports on control switch required by pod type.
- pt_as_port_count
Number of access server ports required by pod type.
- pt_apc_port_count
Number of switched outlet ports required by pod type.
- pt_build
Pod type build number.
- pt_author
Pod type author.
- pt_org
Pod type organization.
- pt_copyright
Pod type copyright.
- pt_url
Pod type URL address.
- pt_removable
Allows pod type to be uninstalled.
- pt_ae_pod
Pod type is for NETLAB+ AE.
- pt_adv_settings
Pod type advanced settings.
- hotspots
Returns array of hotspot information for pt_id.
- remote_pc_layout
Returns array of remote PC layout information for pt_id.
- remote_pc_count
Get a count of the remote PCs per pod type.
- device_layout
Returns array of device layout information for pt_id.
- device_count
Get count of the devices for pod type.
- pod_cat_values
Returns array of pod categories.
- cables
Returns array of cable connections for pod type.
-
pod_types_list
(*, properties='default', **kwargs)¶ Obtain a list of pod types.
- Parameters
properties (list[str] or 'default' or 'all') – Properties consist of any combination of properties listed below under Properties. You may also use “all” to include all properties, or “default” for a smaller subset of properties.
- Returns
On success, returns [rt_id, pt_build, pt_name] by default, or the following properties if requested.
- Return type
Properties
- pt_id
Pod type identifier.
- pt_name
Account email.
- pt_build
Account Family(Last) name.
- pt_gpdid
Global unique identifer.
- pt_apdid
Short unique identifier.???
- pt_desc
Pod type description.
- pt_index
Pod type index.
- pt_type
???
- sched_image
Location of scheduler image.
- def_topology_image
Location of the default topology image.
- def_im_name
Default name ???
- def_vlan_map
Default VLAN map.
- pt_tabs
Pod type tabs.
- pt_actions
Pod type actions.
- pt_origin
Pod type origin.
- pt_vlan_pool
Pod type vlan pool.
- pt_pod_max
Max amount of pod types allowed on system.
- pt_notes
Pod type notes.
- pt_csw_port_count
Number of consecutive ports on control switch required by pod type.
- pt_as_port_count
Number of access server ports required by pod type.
- pt_apc_port_count
Number of switched outlet ports required by pod type.
- pt_build
Pod type build number.
- pt_author
Pod type author.
- pt_org
Pod type organization.
- pt_copyright
Pod type copyright.
- pt_url
Pod type URL address.
- pt_removable
Allows pod type to be uninstalled.
- pt_ae_pod
Is pod type for NETLAB+ AE???.
- pt_adv_settings
Pod type advanced settings.
- remote_pc_count
Get count of the remote PCs per pod type.
- device_count
Get count of the devices per pod type.
-
pod_update
(*, pod_id, pod_name=None, pod_desc=None, pod_auto_net_enabled=None, pod_auto_net_host_setup=None, pod_auto_net_host_teardown=None, pod_adv_settings=None, pod_acl_enabled=None, **kwargs)¶ This method allows you to update a pod on the NETLAB+ system.
- Parameters
pod_id (int) – Unique pod identifier.
pod_name (str) – Pod name.
pod_desc (str) – Pod description.
pod_auto_net_enabled (bool) – Auto-networking enabled.
pod_auto_net_host_setup (bool) – Auto-networking host setup enabled.
pod_auto_net_host_teardown (bool) – Auto-networking host teardown enabled.
pod_adv_settings (str) – Advanced settings for pod configuration.
pod_acl_enabled (bool) – Pod access control list enabled.
- Returns
The update succeeded.
- Return type
‘OK’
-