hpOneView.image_streamer.resources package

Submodules

hpOneView.image_streamer.resources.artifact_bundles module

class hpOneView.image_streamer.resources.artifact_bundles.ArtifactBundles(con)[source]

Bases: object

BACKUPS_PATH = u'/rest/artifact-bundles/backups'
BACKUP_ARCHIVE_PATH = u'/rest/artifact-bundles/backups/archive'
DEFAULT_VALUES = {u'300': {u'type': u'ArtifactsBundle'}}
DEPLOYMENT_GROUPS_URI = u'/rest/deployment-groups/'
DOWNLOAD_PATH = u'/rest/artifact-bundles/download'
STOP_CREATION_PATH = u'/stopArtifactCreate'
URI = u'/rest/artifact-bundles'
create(resource, timeout=-1)[source]

Creates an Artifact Bundle.

Parameters:
  • resource (dict) – Object to create.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView, it just stops waiting for its completion.
Returns:

Created resource.

Return type:

dict

create_backup(resource, timeout=-1)[source]

Creates a backup bundle with all the artifacts present on the appliance. At any given point only one backup bundle will exist on the appliance.

Parameters:
  • resource (dict) – Deployment Group to create the backup.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView, it just stops waiting for its completion.
Returns:

A Deployment Group associated with the Artifact Bundle backup.

Return type:

dict

delete(resource, timeout=-1)[source]

Deletes an Artifact Bundle.

Parameters:
  • resource (str, dict) – Accept either the resource id or the entire resource.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView, it just stops waiting for its completion.
Returns:

Indicates if the resource was successfully deleted.

Return type:

bool

download_archive_artifact_bundle(id_or_uri, file_path)[source]

Downloads an archive for the Artifact Bundle.

Parameters:
  • id_or_uri – ID or URI of the Artifact Bundle.
  • file_path (str) – Destination file path.
Returns:

Successfully downloaded.

Return type:

bool

download_artifact_bundle(id_or_uri, file_path)[source]

Download the Artifact Bundle.

Parameters:
  • id_or_uri – ID or URI of the Artifact Bundle.
  • file_path (str) – Destination file path.
Returns:

Successfully downloaded.

Return type:

bool

extract_backup_bundle(resource, timeout=-1)[source]

Extracts the existing backup bundle on the appliance and creates all the artifacts.

Parameters:
  • resource (dict) – Deployment Group to extract.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView, it just stops waiting for its completion.
Returns:

A Deployment Group associated with the Artifact Bundle backup.

Return type:

dict

extract_bundle(resource, timeout=-1)[source]

Extracts the existing bundle on the appliance and creates all the artifacts.

Parameters:
  • resource (dict) – Artifact Bundle to extract.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView, it just stops waiting for its completion.
Returns:

The Artifact Bundle.

Return type:

dict

get(id_or_uri)[source]

Retrieves the overview details for the selected Artifact Bundle as per the selected attributes.

Parameters:id_or_uri – ID or URI of the Artifact Bundle.
Returns:The Artifact Bundle.
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Gets a list of Artifacts Bundle based on optional sorting and filtering, and constrained by start and count parameters.

Parameters:
  • start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.
  • count

    The number of resources to return. A count of -1 requests all items.

    The actual number of items in the response might differ from the requested count if the sum of start and count exceeds the total number of items.

  • filter (list or str) – A general filter/query string to narrow the list of items returned. The default is no filter; all resources are returned.
  • sort – The sort order of the returned data set. By default, the sort order is based on create time with the oldest entry first.
Returns:

A list of Artifacts Bundle.

Return type:

list

get_all_backups()[source]

Get all Backups for Artifact Bundle.

Returns:A list of Backups for Artifacts Bundle.
Return type:list
get_backup(id_or_uri)[source]

Get the details for the backup from an Artifact Bundle.

Parameters:id_or_uri – ID or URI of the Artifact Bundle.
Returns:Backup for an Artifacts Bundle.
Return type:Dict
get_by(field, value)[source]

Gets all of the Artifacts Bundle resources that match the filter.

The search is case-insensitive.

Parameters:
  • field – Field name to filter.
  • value – Value to filter.
Returns:

The Artifacts Bundle.

Return type:

list

get_by_name(name)[source]

Gets an Artifact Bundle by name.

Parameters:name – Name of the Artifact Bundle.
Returns:The Artifact Bundle.
Return type:dict
stop_artifact_creation(id_or_uri, task_uri)[source]

Stops creation of the selected Artifact Bundle.

Parameters:
  • id_or_uri – ID or URI of the Artifact Bundle.
  • task_uri – Task URI associated with the Artifact Bundle.
Returns:

Return type:

string

update(resource, timeout=-1)[source]

Updates only name for the Artifact Bundle.

Parameters:
  • resource (dict) – Object to update.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView, it just stops waiting for its completion.
Returns:

Updated resource.

Return type:

dict

upload_backup_bundle_from_file(file_path, deployment_groups_id_or_uri)[source]

Restore an Artifact Bundle from a backup file.

Parameters:
  • file_path (str) – The File Path to restore the Artifact Bundle.
  • deployment_groups_id_or_uri – ID or URI of the Deployment Groups.
Returns:

Deployment group.

Return type:

dict

upload_bundle_from_file(file_path)[source]

Restore an Artifact Bundle from a backup file.

Parameters:file_path (str) – The File Path to restore the Artifact Bundle.
Returns:Artifact bundle.
Return type:dict

hpOneView.image_streamer.resources.build_plans module

class hpOneView.image_streamer.resources.build_plans.BuildPlans(con)[source]

Bases: object

DEFAULT_VALUES = {u'300': {u'type': u'OeBuildPlan'}, u'500': {u'type': u'OeBuildPlanV5'}, u'600': {u'type': u'OeBuildPlanV5'}}
URI = u'/rest/build-plans'
create(resource, timeout=-1)[source]

Creates an OS Build Plan using the information provided. The OS Build Plan can be one of the following types - Deploy or Capture.

Parameters:
  • resource (dict) – Object to create.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView, it just stops waiting for its completion.
Returns:

Created OS Build Plan.

Return type:

dict

delete(resource, force=False, timeout=-1)[source]

Deletes an OS Build Plan resource.

Parameters:
  • resource – dict object to delete
  • force – If set to true, the operation completes despite any problems with network connectivity or errors on the resource itself. The default is false.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView; it just stops waiting for its completion.
Returns:

Indicates if the resource was successfully deleted.

Return type:

bool

get(id_or_uri)[source]

Retrieves a specific OS Build Plan resource based on the ID or URI provided.

Parameters:id_or_uri – ID or URI of the Build Plan.
Returns:The OS Build Plan.
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Gets a list of OS Build Plan resources based on optional sorting and filtering, and constrained by start and count parameters.

Parameters:
  • start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.
  • count – The number of resources to return. A count of -1 requests all items. The actual number of items in the response might differ from the requested count if the sum of start and count exceeds the total number of items.
  • filter (list or str) – A general filter/query string to narrow the list of items returned. The default is no filter; all resources are returned.
  • sort – The sort order of the returned data set. By default, the sort order is based on create time with the oldest entry first.
Returns:

A list of OS Build Plan.

Return type:

list

get_by(field, value)[source]

Gets all OS Build Plans that match the filter.

The search is case-insensitive.

Parameters:
  • field – Field name to filter.
  • value – Value to filter.
Returns:

A list of OS Build Plans.

Return type:

list

update(resource, timeout=-1)[source]

Updates the properties of the OS Build Plan.

Parameters:
  • resource (dict) – Object to update.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView, it just stops waiting for its completion.
Returns:

Updated OS Build Plan.

Return type:

dict

hpOneView.image_streamer.resources.deployment_groups module

class hpOneView.image_streamer.resources.deployment_groups.DeploymentGroups(con)[source]

Bases: object

URI = u'/rest/deployment-groups'
get(id_or_uri)[source]

Retrieves the overview details of the selected Deployment Group as per the selected attributes.

Parameters:id_or_uri – ID or URI of the Deployment Group.
Returns:The Deployment Group.
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Gets a list of the Deployment Group based on optional sorting and filtering, and constrained by start and count parameters.

Parameters:
  • start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.
  • count

    The number of resources to return. A count of -1 requests all items.

    The actual number of items in the response might differ from the requested count if the sum of start and count exceeds the total number of items.

  • filter (list or str) – A general filter/query string to narrow the list of items returned. The default is no filter; all resources are returned.
  • sort – The sort order of the returned data set. By default, the sort order is based on create time with the oldest entry first.
Returns:

A list of Deployment Group.

Return type:

list

get_by(field, value)[source]

Gets all Deployment Groups that match the filter.

The search is case-insensitive.

Parameters:
  • field – Field name to filter.
  • value – Value to filter.
Returns:

A list of Deployment Group.

Return type:

list

get_by_name(name)[source]

Gets a Deployment Group by name.

Parameters:name – Name of the Deployment Group.
Returns:The Deployment Group.
Return type:dict

hpOneView.image_streamer.resources.deployment_plans module

class hpOneView.image_streamer.resources.deployment_plans.DeploymentPlans(con)[source]

Bases: object

URI = u'/rest/deployment-plans'
create(resource, timeout=-1)[source]

Adds a Deployment Plan based on the attributes specified.

Parameters:
  • resource (dict) – Object to create.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView, it just stops waiting for its completion.
Returns:

Created Deployment plan.

Return type:

dict

delete(resource, force=False, timeout=-1)[source]

Deletes the Deployment Plan.

Parameters:
  • resource – dict object to delete
  • force – If set to true, the operation completes despite any problems with network connectivity or errors on the resource itself. The default is false.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView; it just stops waiting for its completion.
Returns:

Indicates if the resource was successfully deleted.

Return type:

bool

get(id_or_uri)[source]

Retrieves a specific Deployment Plan resource based on the ID or URI provided.

Parameters:id_or_uri – ID or URI of the Deployment Plan.
Returns:The Deployment Plan.
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Gets a list of Deployment Plans resources based on optional sorting and filtering, and constrained by start and count parameters.

Parameters:
  • start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.
  • count – The number of resources to return. A count of -1 requests all items. The actual number of items in the response might differ from the requested count if the sum of start and count exceeds the total number of items.
  • filter (list or str) – A general filter/query string to narrow the list of items returned. The default is no filter; all resources are returned.
  • sort – The sort order of the returned data set. By default, the sort order is based on create time with the oldest entry first.
Returns:

A list of Deployment Plan.

Return type:

list

get_by(field, value)[source]

Gets all Deployment Plans that match the filter.

The search is case-insensitive.

Parameters:
  • field – Field name to filter.
  • value – Value to filter.
Returns:

A list of Deployment Plans.

Return type:

list

get_osdp(id_or_uri)[source]

Retrieves facts about Server Profiles and Server Profile Templates that are using Deployment Plan based on the ID or URI provided.

Parameters:id_or_uri – ID or URI of the Deployment Plan.
Returns:Server Profiles and Server Profile Templates
Return type:dict
get_usedby(id_or_uri)[source]

Retrieves the OS deployment plan details from OneView for a deployment plan resource based on the ID or URI provided.

Parameters:id_or_uri – ID or URI of the Deployment Plan.
Returns:The OS Deployment Plan.
Return type:dict
update(resource, timeout=-1)[source]

Updates the properties of the Deployment Plan.

Parameters:
  • resource (dict) – Object to update.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView, it just stops waiting for its completion.
Returns:

Updated Deployment Plan.

Return type:

dict

hpOneView.image_streamer.resources.golden_images module

class hpOneView.image_streamer.resources.golden_images.GoldenImages(con)[source]

Bases: object

URI = u'/rest/golden-images'
create(resource, timeout=-1)[source]

Creates a Golden Image resource from the deployed OS Volume as per the attributes specified.

Parameters:
  • resource (dict) – Object to create.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView, it just stops waiting for its completion.
Returns:

Golden Image created.

Return type:

dict

delete(resource, force=False, timeout=-1)[source]

Deletes the Golden Image specified.

Parameters:
  • resource – dict object to delete
  • force – If set to true, the operation completes despite any problems with network connectivity or errors on the resource itself. The default is false.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView; it just stops waiting for its completion.
Returns:

Indicates if the resource was successfully deleted.

Return type:

bool

download(id_or_uri, file_path)[source]

Downloads the content of the selected Golden Image as per the specified attributes.

Parameters:
  • id_or_uri – ID or URI of the Golden Image.
  • file_path (str) – Destination file path.
Returns:

Successfully downloaded.

Return type:

bool

download_archive(id_or_uri, file_path)[source]

Download the details of the Golden Image capture logs, which has been archived based on the specific attribute ID.

Parameters:
  • id_or_uri – ID or URI of the Golden Image.
  • file_path (str) – File name to save the archive.
Returns:

Success.

Return type:

bool

get(id_or_uri)[source]

Retrieves the overview details of the selected Golden Image as per the specified attributes.

Parameters:id_or_uri – ID or URI of the Golden Image.
Returns:The Golden Image.
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Retrieves a list of Golden Image resources as per the specified parameters.

Parameters:
  • start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.
  • count

    The number of resources to return. A count of -1 requests all items.

    The actual number of items in the response might differ from the requested count if the sum of start and count exceeds the total number of items.

  • filter (list or str) – A general filter/query string to narrow the list of items returned. The default is no filter; all resources are returned.
  • sort – The sort order of the returned data set. By default, the sort order is based on create time with the oldest entry first.
Returns:

A list of Golden Images.

Return type:

list

get_by(field, value)[source]

Gets all Golden Images that match the filter.

The search is case-insensitive.

Parameters:
  • field – Field name to filter.
  • value – Value to filter.
Returns:

A list of Golden Images.

Return type:

list

update(resource, timeout=-1)[source]

Updates the properties of the Golden Image.

Parameters:
  • resource (dict) – Object to update.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView, it just stops waiting for its completion.
Returns:

Updated resource.

Return type:

dict

upload(file_path, golden_image_info)[source]

Adds a Golden Image resource from the file that is uploaded from a local drive. Only the .zip format file can be used for the upload.

Parameters:
  • file_path (str) – File name to upload.
  • golden_image_info (dict) – Golden Image information.
Returns:

Golden Image.

Return type:

dict

hpOneView.image_streamer.resources.os_volumes module

class hpOneView.image_streamer.resources.os_volumes.OsVolumes(con)[source]

Bases: object

URI = u'/rest/os-volumes'
download_archive(name, file_path)[source]

Download archived logs of the OS Volume.

Parameters:
  • name – Name of the OS Volume.
  • file_path (str) – Destination file path.
Returns:

Indicates if the resource was successfully downloaded.

Return type:

bool

get(id_or_uri)[source]

Retrieves the overview details of the selected OS Volume as per the selected attributes.

Parameters:id_or_uri – ID or URI of the OS Volume.
Returns:The OS Volume.
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Gets a list of the OS Volume based on optional sorting and filtering, and constrained by start and count parameters.

Parameters:
  • start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.
  • count

    The number of resources to return. A count of -1 requests all items.

    The actual number of items in the response might differ from the requested count if the sum of start and count exceeds the total number of items.

  • filter (list or str) – A general filter/query string to narrow the list of items returned. The default is no filter; all resources are returned.
  • sort – The sort order of the returned data set. By default, the sort order is based on create time with the oldest entry first.
Returns:

A list of OS Volume.

Return type:

list

get_by(field, value)[source]

Gets all OS Volume that match the filter.

The search is case-insensitive.

Parameters:
  • field – Field name to filter.
  • value – Value to filter.
Returns:

A list of OS Volume.

Return type:

list

get_by_name(name)[source]

Gets an OS Volume by name.

Parameters:name – Name of the OS Volume.
Returns:The OS Volume.
Return type:dict
get_storage(id_or_uri)[source]

Get storage details of an OS Volume.

Parameters:id_or_uri – ID or URI of the OS Volume.
Returns:Storage details
Return type:dict

hpOneView.image_streamer.resources.plan_scripts module

class hpOneView.image_streamer.resources.plan_scripts.PlanScripts(con)[source]

Bases: object

URI = u'/rest/plan-scripts'
create(resource, timeout=-1)[source]

Adds a Plan Script using the information provided in the request body. The plan type can be one of the following types: General, deploy and capture. Note: The OS type for the Plan Script is always assigned as “ESXi”.

Parameters:
  • resource (dict) – Object to create.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView, it just stops waiting for its completion.
Returns:

Created Plan Script.

Return type:

dict

delete(resource, force=False, timeout=-1)[source]

Deletes a Plan Script object from the appliance based on its Plan Script UUID.

Parameters:
  • resource – dict object to delete
  • force – If set to true, the operation completes despite any problems with network connectivity or errors on the resource itself. The default is false.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView; it just stops waiting for its completion.
Returns:

Indicates if the resource was successfully deleted.

Return type:

bool

get(id_or_uri)[source]

Retrieves the overview details of the selected Plan Script as per the selected attributes.

Parameters:id_or_uri – ID or URI of the Plan Script.
Returns:The Plan Script.
Return type:dict
get_all(start=0, count=-1, filter=u'', sort=u'')[source]

Gets a list of Plan Scripts based on optional sorting and filtering, and constrained by start and count parameters.

Parameters:
  • start – The first item to return, using 0-based indexing. If not specified, the default is 0 - start with the first available item.
  • count

    The number of resources to return. A count of -1 requests all items.

    The actual number of items in the response might differ from the requested count if the sum of start and count exceeds the total number of items.

  • filter (list or str) – A general filter/query string to narrow the list of items returned. The default is no filter; all resources are returned.
  • sort – The sort order of the returned data set. By default, the sort order is based on create time with the oldest entry first.
Returns:

A list of Plan Scripts.

Return type:

list

get_by(field, value)[source]

Gets all Plan Scripts that match the filter.

The search is case-insensitive.

Parameters:
  • field – Field name to filter.
  • value – Value to filter.
Returns:

A list of Plan Scripts.

Return type:

list

get_usedby_and_readonly(id)[source]

Gets the build plans details os teh selected plan script as per the selected attributes.

Parameters:id – ID of the Plan Script.
Returns:array of build plans
retrieve_differences(id_or_uri, content, timeout=-1)[source]

Retrieves the modified contents of the selected Plan Script according to the provided content object, as per the selected attributes.

Parameters:
  • id_or_uri – ID or URI of the Plan Script.
  • content (str) – Plan Script content.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView, it just stops waiting for its completion.
Returns:

Script differences.

Return type:

dict

update(resource, timeout=-1)[source]

Updates the properties of the Plan Script.

Parameters:
  • resource (dict) – Object to update.
  • timeout – Timeout in seconds. Waits for task completion by default. The timeout does not abort the operation in OneView, it just stops waiting for its completion.
Returns:

Updated resource.

Return type:

dict

Module contents