yellowdog_client.compute
– Compute¶
All functionality is accessed via the yellowdog_client.compute.ComputeClient
.
- class yellowdog_client.compute.ComputeClient¶
The API interface exposed by the YellowDog Compute Service
- abstract add_compute_requirement(compute_requirement)¶
Submits a NEW requirement to YellowDog Compute to be initialised and provisioned.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement to submit to YellowDog Compute- Return type:
- Returns:
the initialised requirement returned from YellowDog Compute
- abstract add_compute_requirement_listener(compute_requirement, listener)¶
Adds an event listener to receive notifications of changes for the specified requirement. The client manages subscriptions to YellowDog Compute such that the first listener created for a requirement will cause a Server-Sent Events subscription to be initiated; additional listeners for the same requirement share that subscription.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement for which to receive notificationslistener (
SubscriptionEventListener
[ComputeRequirement
]) – the event listener that will be invoked for notifications
- Return type:
- abstract add_compute_requirement_listener_by_id(compute_requirement_id, listener)¶
Adds an event listener to receive notifications of changes for the specified requirement. The client manages subscriptions to YellowDog Compute such that the first listener created for a requirement will cause a Server-Sent Events subscription to be initiated; additional listeners for the same requirement share that subscription.
- Parameters:
compute_requirement_id (
str
) – the ID of the requirement for which to receive notificationslistener (
SubscriptionEventListener
[ComputeRequirement
]) – the event listener that will be invoked for notifications
- Return type:
- abstract add_compute_requirement_template(compute_requirement_template)¶
- Parameters:
compute_requirement_template (
ComputeRequirementTemplate
)- Return type:
- abstract add_compute_source_template(compute_source_template)¶
- Parameters:
compute_source_template (
ComputeSourceTemplate
)- Return type:
- abstract delete_compute_requirement_template(compute_requirement_template)¶
- Parameters:
compute_requirement_template (
ComputeRequirementTemplate
)- Return type:
- abstract delete_compute_requirement_template_by_id(compute_requirement_template_id)¶
- abstract delete_compute_source_template(compute_source_template)¶
- Parameters:
compute_source_template (
ComputeSourceTemplate
)- Return type:
- abstract delete_compute_source_template_by_id(compute_source_template_id)¶
- abstract deprovision_instances(compute_requirement, instances)¶
Instructs YellowDog Compute to terminate the specified instances provisioned for the specified requirement and reduce the requirement’s instance count accordingly. YellowDog Compute will not attempt to deprovision instances that are already InstanceStatus#TERMINATING.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instances
- Return type:
- abstract deprovision_instances_by_id(compute_requirement, instance_ids)¶
Instructs YellowDog Compute to terminate the specified instances provisioned for the specified requirement and reduce the requirement’s instance count accordingly. YellowDog Compute will not attempt to deprovision instances that are already InstanceStatus#TERMINATING.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instancesinstance_ids (
List
[InstanceId
]) – the ids of instances to deprovision
- Return type:
- abstract find_all_compute_requirement_templates()¶
Returns summaries of all existing compute requirement templates within the system for the requesting user.
- Return type:
- Returns:
a list of compute requirement template summaries
- abstract find_all_compute_source_templates()¶
- Return type:
- abstract get_best_compute_source_report_by_compute_requirement(provisioned_compute_requirement_id)¶
Gets the provision report for a compute requirement provisioned from a dynamic template.
- Parameters:
provisioned_compute_requirement_id (
str
) – the ID of the provisioned compute requirement- Return type:
- Returns:
the provision report for a compute requirement provisioned from a dynamic template
- abstract get_compute_requirement(compute_requirement)¶
Requests the latest view of the specified requirement from YellowDog Compute.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement for which to get the latest view- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- abstract get_compute_requirement_by_id(compute_requirement_id)¶
Requests the latest view of the specified requirement from YellowDog Compute.
- Parameters:
compute_requirement_id (
str
) – the ID of the requirement- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- abstract get_compute_requirement_by_name(namespace, compute_requirement_name)¶
Requests the latest view of the specified requirement from YellowDog Compute.
- Parameters:
- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- abstract get_compute_requirement_helper(compute_requirement)¶
Constructs a new compute requirement helper for the specified requirement.
- Parameters:
compute_requirement (
ComputeRequirement
) – the compute requirement for which the helper will be constructed- Return type:
- Returns:
a new compute requirement helper
- abstract get_compute_requirement_helper_by_id(compute_requirement_id)¶
Constructs a new compute requirement helper for the specified requirement.
- Parameters:
compute_requirement_id (
str
) – the ID of the compute requirement for which the helper will be constructed- Return type:
- Returns:
a new compute requirement helper
- abstract get_compute_requirement_summaries(compute_requirement_summary_search)¶
- Parameters:
compute_requirement_summary_search (
ComputeRequirementSummarySearch
)- Return type:
SearchClient
[ComputeRequirementSummary
]
- abstract get_compute_requirement_template(compute_requirement_template_id)¶
- Parameters:
compute_requirement_template_id (
str
)- Return type:
- abstract get_compute_requirement_template_by_id(compute_requirement_template_id)¶
- Parameters:
compute_requirement_template_id (
str
)- Return type:
- abstract get_compute_requirement_template_by_name(namespace, name)¶
- Parameters:
- Return type:
- abstract get_compute_requirements(compute_requirement_search)¶
Returns a search client for searching compute requirements.
- Parameters:
compute_requirement_search (
ComputeRequirementSearch
) – the search criteria- Return type:
SearchClient
[ComputeRequirement
]- Returns:
a search client for searching compute requirements
@deprecated use #getComputeRequirementSummaries(ComputeRequirementSummarySearch) instead.
- abstract get_compute_source_template(compute_source_template_id)¶
- Parameters:
compute_source_template_id (
str
)- Return type:
- abstract get_instances(instance_search)¶
Returns a search client for searching instances.
- Parameters:
instance_search (
InstanceSearch
) – the search criteria- Return type:
SearchClient
[Instance
]- Returns:
a search client for searching instances
- abstract is_compute_requirement_updating(compute_requirement)¶
Checks the current busy state of the specified requirement, returning true if the requirement is being updated by YellowDog Compute; otherwise, false.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement to check- Return type:
- Returns:
true, if the requirement is being updated by YellowDog Compute; otherwise, false
- abstract is_compute_requirement_updating_by_id(compute_requirement_id)¶
Checks the current busy state of the specified requirement, returning true if the requirement is being updated by YellowDog Compute; otherwise, false.
- abstract provision_compute_requirement_template(compute_requirement_template_usage)¶
Provisions a new compute requirement based on the specified template and requirement properties.
- Parameters:
compute_requirement_template_usage (
ComputeRequirementTemplateUsage
) – An object defining the template ID and requirement properties- Return type:
- Returns:
the provisioned compute requirement
- abstract remove_compute_requirement_listener(listener)¶
Removes the specified event listener. The client manages subscriptions to YellowDog Compute such that when the last listener for a requirement is removed, the associated Server-Sent Events subscription is cancelled.
- Parameters:
listener (
SubscriptionEventListener
[ComputeRequirement
]) – the event listener that will no longer be invoked for notifications- Return type:
- abstract reprovision_compute_requirement(compute_requirement)¶
Instructs YellowDog Compute to provision more instances if required such that the number of running instances meets the targetInstanceCount.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement to terminate- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- abstract reprovision_compute_requirement_by_id(compute_requirement_id)¶
Instructs YellowDog Compute to provision more instances if required such that the number of running instances meets the targetInstanceCount.
- Parameters:
compute_requirement_id (
str
) – the ID of the requirement to terminate- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- abstract restart_instances(compute_requirement, instances)¶
Instructs YellowDog Compute to restart (reboot) the specified instances provisioned for the specified requirement. YellowDog Compute will only attempt to restart instances that are InstanceStatus#RUNNING, InstanceStatus#STOPPED or InstanceStatus#UNKNOWN.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instances
- Return type:
- abstract restart_instances_by_id(compute_requirement, instance_ids)¶
Instructs YellowDog Compute to restart (reboot) the specified instances provisioned for the specified requirement. YellowDog Compute will only attempt to restart instances that are InstanceStatus#RUNNING, InstanceStatus#STOPPED or InstanceStatus#UNKNOWN.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instancesinstance_ids (
List
[InstanceId
]) – the instances to restart
- Return type:
- abstract start_compute_requirement(compute_requirement)¶
Instructs YellowDog Compute to start all stopped instances provisioned for the specified requirement.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement to start- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- abstract start_compute_requirement_by_id(compute_requirement_id)¶
Instructs YellowDog Compute to start all stopped instances provisioned for the specified requirement.
- Parameters:
compute_requirement_id (
str
) – the ID of the requirement to start- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- abstract start_instances(compute_requirement, instances)¶
Instructs YellowDog Compute to start the specified instances provisioned for the specified requirement. YellowDog Compute will only attempt to start instances that are InstanceStatus#STOPPED or InstanceStatus#UNKNOWN.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instances
- Return type:
- abstract start_instances_by_id(compute_requirement, instance_ids)¶
Instructs YellowDog Compute to start the specified instances provisioned for the specified requirement. YellowDog Compute will only attempt to start instances that are InstanceStatus#STOPPED or InstanceStatus#UNKNOWN.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instancesinstance_ids (
List
[InstanceId
]) – the ids of instances to start
- Return type:
- abstract stop_compute_requirement(compute_requirement)¶
Instructs YellowDog Compute to stop all running instances provisioned for the specified requirement.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement to stop- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- abstract stop_compute_requirement_by_id(compute_requirement_id)¶
Instructs YellowDog Compute to stop all running instances provisioned for the specified requirement.
- Parameters:
compute_requirement_id (
str
) – the ID of the requirement to stop- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- abstract stop_instances(compute_requirement, instances)¶
Instructs YellowDog Compute to stop the specified instances provisioned for the specified requirement. YellowDog Compute will only attempt to stop instances that are InstanceStatus#RUNNING or InstanceStatus#UNKNOWN.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instances
- Return type:
- abstract stop_instances_by_id(compute_requirement, instance_ids)¶
Instructs YellowDog Compute to stop the specified instances provisioned for the specified requirement. YellowDog Compute will only attempt to stop instances that are InstanceStatus#RUNNING or InstanceStatus#UNKNOWN.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instancesinstance_ids (
List
[InstanceId
]) – the ids of instances to stop
- Return type:
- abstract terminate_compute_requirement(compute_requirement)¶
Instructs YellowDog Compute to terminate the specified requirement.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement to terminate- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- abstract terminate_compute_requirement_by_id(compute_requirement_id)¶
Instructs YellowDog Compute to terminate the specified requirement.
- Parameters:
compute_requirement_id (
str
) – the ID of the requirement to terminate- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- abstract terminate_instances(compute_requirement, instances)¶
Instructs YellowDog Compute to terminate the specified instances provisioned for the specified requirement. YellowDog Compute will not attempt to terminate instances that are already InstanceStatus#TERMINATING.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instances
- Return type:
- abstract terminate_instances_by_id(compute_requirement, instance_ids)¶
Instructs YellowDog Compute to terminate the specified instances provisioned for the specified requirement. YellowDog Compute will not attempt to terminate instances that are already InstanceStatus#TERMINATING.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instancesinstance_ids (
List
[InstanceId
]) – the ids of instances to terminate
- Return type:
- abstract test_compute_requirement_template(compute_requirement_template_usage)¶
Generates a new compute requirement based on the specified template and requirement properties. Includes other related information such as a BestComputeSourceReport if relevant.
- Parameters:
compute_requirement_template_usage (
ComputeRequirementTemplateUsage
) – An object defining the template ID and requirement properties- Return type:
- Returns:
the template test result
- abstract update_compute_requirement(compute_requirement, reprovision=None)¶
Submits an existing requirement to YellowDog Compute in order to provision any changes.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement to submit to YellowDog Computereprovision (
Optional
[bool
]) – indicates that YellowDog Compute should provision instances to restore the instance count even if targetInstanceCount is unchanged
- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- abstract update_compute_requirement_template(compute_requirement_template)¶
- Parameters:
compute_requirement_template (
ComputeRequirementTemplate
)- Return type:
- abstract update_compute_source_template(compute_source_template)¶
- Parameters:
compute_source_template (
ComputeSourceTemplate
)- Return type:
- class yellowdog_client.compute.ComputeClientImpl(service_proxy)¶
- Parameters:
service_proxy (
ComputeServiceProxy
)
- add_compute_requirement(compute_requirement)¶
Submits a NEW requirement to YellowDog Compute to be initialised and provisioned.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement to submit to YellowDog Compute- Return type:
- Returns:
the initialised requirement returned from YellowDog Compute
- add_compute_requirement_listener(compute_requirement, listener)¶
Adds an event listener to receive notifications of changes for the specified requirement. The client manages subscriptions to YellowDog Compute such that the first listener created for a requirement will cause a Server-Sent Events subscription to be initiated; additional listeners for the same requirement share that subscription.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement for which to receive notificationslistener (
SubscriptionEventListener
) – the event listener that will be invoked for notifications
- Return type:
- add_compute_requirement_listener_by_id(compute_requirement_id, listener)¶
Adds an event listener to receive notifications of changes for the specified requirement. The client manages subscriptions to YellowDog Compute such that the first listener created for a requirement will cause a Server-Sent Events subscription to be initiated; additional listeners for the same requirement share that subscription.
- add_compute_requirement_template(template)¶
- Parameters:
template (
ComputeRequirementTemplate
)- Return type:
- add_compute_source_template(compute_source_template)¶
- Parameters:
compute_source_template (
ComputeSourceTemplate
)- Return type:
- delete_compute_requirement_template(compute_requirement_template)¶
- Parameters:
compute_requirement_template (
ComputeRequirementTemplate
)- Return type:
- delete_compute_requirement_template_by_id(compute_requirement_template_id)¶
- delete_compute_source_template(compute_source_template)¶
- Parameters:
compute_source_template (
ComputeSourceTemplate
)- Return type:
- delete_compute_source_template_by_id(compute_source_template_id)¶
- deprovision_instances(compute_requirement, instances)¶
Instructs YellowDog Compute to terminate the specified instances provisioned for the specified requirement and reduce the requirement’s instance count accordingly. YellowDog Compute will not attempt to deprovision instances that are already InstanceStatus#TERMINATING.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instances
- Return type:
- deprovision_instances_by_id(compute_requirement, instance_ids)¶
Instructs YellowDog Compute to terminate the specified instances provisioned for the specified requirement and reduce the requirement’s instance count accordingly. YellowDog Compute will not attempt to deprovision instances that are already InstanceStatus#TERMINATING.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instancesinstance_ids (
List
[InstanceId
]) – the ids of instances to deprovision
- Return type:
- find_all_compute_requirement_templates()¶
Returns summaries of all existing compute requirement templates within the system for the requesting user.
- Return type:
- Returns:
a list of compute requirement template summaries
- find_all_compute_source_templates()¶
- Return type:
- get_best_compute_source_report_by_compute_requirement(provisioned_requirement_id)¶
Gets the provision report for a compute requirement provisioned from a dynamic template.
- Parameters:
provisioned_compute_requirement_id – the ID of the provisioned compute requirement
provisioned_requirement_id (
str
)
- Return type:
- Returns:
the provision report for a compute requirement provisioned from a dynamic template
- get_compute_requirement(compute_requirement)¶
Requests the latest view of the specified requirement from YellowDog Compute.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement for which to get the latest view- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- get_compute_requirement_by_id(compute_requirement_id)¶
Requests the latest view of the specified requirement from YellowDog Compute.
- Parameters:
compute_requirement_id (
str
) – the ID of the requirement- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- get_compute_requirement_by_name(namespace, compute_requirement_name)¶
Requests the latest view of the specified requirement from YellowDog Compute.
- Parameters:
- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- get_compute_requirement_helper(compute_requirement)¶
Constructs a new compute requirement helper for the specified requirement.
- Parameters:
compute_requirement (
ComputeRequirement
) – the compute requirement for which the helper will be constructed- Return type:
- Returns:
a new compute requirement helper
- get_compute_requirement_helper_by_id(compute_requirement_id)¶
Constructs a new compute requirement helper for the specified requirement.
- Parameters:
compute_requirement_id (
str
) – the ID of the compute requirement for which the helper will be constructed- Return type:
- Returns:
a new compute requirement helper
- get_compute_requirement_summaries(compute_requirement_summary_search)¶
- Parameters:
compute_requirement_summary_search (
ComputeRequirementSummarySearch
)- Return type:
SearchClient
[ComputeRequirementSummary
]
- get_compute_requirement_template(compute_requirement_template_id)¶
- Parameters:
compute_requirement_template_id (
str
)- Return type:
- get_compute_requirement_template_by_id(compute_requirement_template_id)¶
- Parameters:
compute_requirement_template_id (
str
)- Return type:
- get_compute_requirement_template_by_name(namespace, name)¶
- Parameters:
- Return type:
- get_compute_requirements(compute_requirement_search)¶
Returns a search client for searching compute requirements.
- Parameters:
compute_requirement_search (
ComputeRequirementSearch
) – the search criteria- Return type:
SearchClient
[ComputeRequirement
]- Returns:
a search client for searching compute requirements
@deprecated use #getComputeRequirementSummaries(ComputeRequirementSummarySearch) instead.
- get_compute_source_template(compute_source_template_id)¶
- Parameters:
compute_source_template_id (
str
)- Return type:
- get_instances(instance_search)¶
Returns a search client for searching instances.
- Parameters:
instance_search (
InstanceSearch
) – the search criteria- Return type:
SearchClient
[Instance
]- Returns:
a search client for searching instances
- is_compute_requirement_updating(compute_requirement)¶
Checks the current busy state of the specified requirement, returning true if the requirement is being updated by YellowDog Compute; otherwise, false.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement to check- Return type:
- Returns:
true, if the requirement is being updated by YellowDog Compute; otherwise, false
- is_compute_requirement_updating_by_id(compute_requirement_id)¶
Checks the current busy state of the specified requirement, returning true if the requirement is being updated by YellowDog Compute; otherwise, false.
- provision_compute_requirement_template(template_request)¶
Provisions a new compute requirement based on the specified template and requirement properties.
- Parameters:
compute_requirement_template_usage – An object defining the template ID and requirement properties
template_request (
ComputeRequirementTemplateUsage
)
- Return type:
- Returns:
the provisioned compute requirement
- remove_compute_requirement_listener(listener)¶
Removes the specified event listener. The client manages subscriptions to YellowDog Compute such that when the last listener for a requirement is removed, the associated Server-Sent Events subscription is cancelled.
- Parameters:
listener (
SubscriptionEventListener
[ComputeRequirement
]) – the event listener that will no longer be invoked for notifications
- reprovision_compute_requirement(compute_requirement)¶
Instructs YellowDog Compute to provision more instances if required such that the number of running instances meets the targetInstanceCount.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement to terminate- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- reprovision_compute_requirement_by_id(compute_requirement_id)¶
Instructs YellowDog Compute to provision more instances if required such that the number of running instances meets the targetInstanceCount.
- Parameters:
compute_requirement_id (
str
) – the ID of the requirement to terminate- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- restart_instances(compute_requirement, instances)¶
Instructs YellowDog Compute to restart (reboot) the specified instances provisioned for the specified requirement. YellowDog Compute will only attempt to restart instances that are InstanceStatus#RUNNING, InstanceStatus#STOPPED or InstanceStatus#UNKNOWN.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instances
- Return type:
- restart_instances_by_id(compute_requirement, instance_ids)¶
Instructs YellowDog Compute to restart (reboot) the specified instances provisioned for the specified requirement. YellowDog Compute will only attempt to restart instances that are InstanceStatus#RUNNING, InstanceStatus#STOPPED or InstanceStatus#UNKNOWN.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instancesinstance_ids (
List
[InstanceId
]) – the instances to restart
- Return type:
- start_compute_requirement(compute_requirement)¶
Instructs YellowDog Compute to start all stopped instances provisioned for the specified requirement.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement to start- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- start_compute_requirement_by_id(compute_requirement_id)¶
Instructs YellowDog Compute to start all stopped instances provisioned for the specified requirement.
- Parameters:
compute_requirement_id (
str
) – the ID of the requirement to start- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- start_instances(compute_requirement, instances)¶
Instructs YellowDog Compute to start the specified instances provisioned for the specified requirement. YellowDog Compute will only attempt to start instances that are InstanceStatus#STOPPED or InstanceStatus#UNKNOWN.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instances
- Return type:
- start_instances_by_id(compute_requirement, instance_ids)¶
Instructs YellowDog Compute to start the specified instances provisioned for the specified requirement. YellowDog Compute will only attempt to start instances that are InstanceStatus#STOPPED or InstanceStatus#UNKNOWN.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instancesinstance_ids (
List
[InstanceId
]) – the ids of instances to start
- Return type:
- stop_compute_requirement(compute_requirement)¶
Instructs YellowDog Compute to stop all running instances provisioned for the specified requirement.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement to stop- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- stop_compute_requirement_by_id(compute_requirement_id)¶
Instructs YellowDog Compute to stop all running instances provisioned for the specified requirement.
- Parameters:
compute_requirement_id (
str
) – the ID of the requirement to stop- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- stop_instances(compute_requirement, instances)¶
Instructs YellowDog Compute to stop the specified instances provisioned for the specified requirement. YellowDog Compute will only attempt to stop instances that are InstanceStatus#RUNNING or InstanceStatus#UNKNOWN.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instances
- Return type:
- stop_instances_by_id(compute_requirement, instance_ids)¶
Instructs YellowDog Compute to stop the specified instances provisioned for the specified requirement. YellowDog Compute will only attempt to stop instances that are InstanceStatus#RUNNING or InstanceStatus#UNKNOWN.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instancesinstance_ids (
List
[InstanceId
]) – the ids of instances to stop
- Return type:
- terminate_compute_requirement(compute_requirement)¶
Instructs YellowDog Compute to terminate the specified requirement.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement to terminate- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- terminate_compute_requirement_by_id(compute_requirement_id)¶
Instructs YellowDog Compute to terminate the specified requirement.
- Parameters:
compute_requirement_id (
str
) – the ID of the requirement to terminate- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- terminate_instances(compute_requirement, instances)¶
Instructs YellowDog Compute to terminate the specified instances provisioned for the specified requirement. YellowDog Compute will not attempt to terminate instances that are already InstanceStatus#TERMINATING.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instances
- Return type:
- terminate_instances_by_id(compute_requirement, instance_ids)¶
Instructs YellowDog Compute to terminate the specified instances provisioned for the specified requirement. YellowDog Compute will not attempt to terminate instances that are already InstanceStatus#TERMINATING.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement containing the instancesinstance_ids (
List
[InstanceId
]) – the ids of instances to terminate
- Return type:
- test_compute_requirement_template(template_usage)¶
Generates a new compute requirement based on the specified template and requirement properties. Includes other related information such as a BestComputeSourceReport if relevant.
- Parameters:
compute_requirement_template_usage – An object defining the template ID and requirement properties
template_usage (
ComputeRequirementTemplateUsage
)
- Return type:
- Returns:
the template test result
- update_compute_requirement(compute_requirement, reprovision=False)¶
Submits an existing requirement to YellowDog Compute in order to provision any changes.
- Parameters:
compute_requirement (
ComputeRequirement
) – the requirement to submit to YellowDog Computereprovision (
bool
) – indicates that YellowDog Compute should provision instances to restore the instance count even if targetInstanceCount is unchanged
- Return type:
- Returns:
the latest view of the requirement returned from YellowDog Compute
- update_compute_requirement_template(compute_requirement_template)¶
- Parameters:
compute_requirement_template (
ComputeRequirementTemplate
)- Return type:
- update_compute_source_template(compute_source_template)¶
- Parameters:
compute_source_template (
ComputeSourceTemplate
)- Return type:
- class yellowdog_client.compute.ComputeRequirementHelper(compute_requirement, compute_service_client_impl)¶
This class provides a number of methods that return a
concurrent.futures.Future
allowing consumers to simply wait for the required state of a compute requirement before continuing on.Constructor accepts the following arguments:
- Parameters:
compute_requirement (ComputeRequirement) – The compute requirement.
compute_service_client_impl (ComputeClient) – The compute service client.
- when_requirement_matches(predicate)¶
Returns a
concurrent.futures.Future
that is completed when the specified predicate evaluates to true.- Parameters:
predicate (Callable[[
yellowdog_client.model.ComputeRequirement
],bool
]) – The predicate to test for each compute requirement changed event received.- Returns:
A
concurrent.futures.Future
containing the matching compute requirement.- Return type:
from concurrent import futures from yellowdog_client.model import ComputeRequirementStatus future = helper.when_requirement_matches(lambda req: req.status == ComputeRequirementStatus.TERMINATED) futures.wait(fs=(future,)) future_compute_requirement = future.result() # ComputeRequirement
- when_requirement_status_is(status)¶
Returns a task that is completed when the compute requirement status matches the specified status.
- Parameters:
status (
yellowdog_client.model.ComputeRequirementStatus
) – The compute requirement status to wait for.- Returns:
A
concurrent.futures.Future
containing the matching compute requirement.- Return type:
from concurrent import futures from yellowdog_client.model import ComputeRequirementStatus future = helper.when_requirement_status_is(ComputeRequirementStatus.RUNNING) futures.wait(fs=(future,)) future_compute_requirement = future.result() # ComputeRequirement
- class yellowdog_client.compute.ComputeServiceProxy(proxy)¶
- Parameters:
proxy (
Proxy
)
- add_compute_requirement(compute_requirement)¶
- Parameters:
compute_requirement (
ComputeRequirement
)- Return type:
- add_compute_requirement_template(template)¶
- Parameters:
template (
ComputeRequirementTemplate
)- Return type:
- add_compute_source_template(compute_source_template)¶
- Parameters:
compute_source_template (
ComputeSourceTemplate
)- Return type:
- delete_compute_source_template(compute_source_template_id)¶
- deprovision_instances(compute_requirement, instance_ids)¶
- Parameters:
compute_requirement (
ComputeRequirement
)instance_ids (
List
[InstanceId
])
- Return type:
- find_all_compute_requirement_templates()¶
- Return type:
- find_all_compute_source_templates()¶
- Return type:
- get_best_compute_source_report_by_requirement_id(provisioned_requirement_id)¶
- Parameters:
provisioned_requirement_id (
str
)- Return type:
- get_compute_requirement_by_id(compute_requirement_id)¶
- Parameters:
compute_requirement_id (
str
)- Return type:
- get_compute_requirement_by_name(namespace, compute_requirement_name)¶
- Parameters:
- Return type:
- get_compute_requirement_template_by_name(namespace, name)¶
- Parameters:
- Return type:
- get_compute_source_template_by_id(compute_source_template_id)¶
- Parameters:
compute_source_template_id (
str
)- Return type:
- is_compute_requirement_updating(compute_requirement_id)¶
- provision_compute_requirement_template(usage)¶
- Parameters:
usage (
ComputeRequirementTemplateUsage
)- Return type:
- search_compute_requirement_summaries(search, slice_reference)¶
- Parameters:
search (
ComputeRequirementSummarySearch
)slice_reference (
SliceReference
)
- Return type:
- search_compute_requirements(search, slice_reference)¶
- Parameters:
search (
ComputeRequirementSearch
)slice_reference (
SliceReference
)
- Return type:
- search_instances(search, slice_reference)¶
- Parameters:
search (
InstanceSearch
)slice_reference (
SliceReference
)
- Return type:
- stream_compute_requirement_updates(compute_requirement_id)¶
- Parameters:
compute_requirement_id (
str
)- Return type:
EventSource
- test_compute_requirement_template(template_usage)¶
- Parameters:
template_usage (
ComputeRequirementTemplateUsage
)- Return type:
- transition_compute_requirement(compute_requirement_id, next_status)¶
- Parameters:
compute_requirement_id (
str
)next_status (
ComputeRequirementStatus
)
- transition_instances(compute_requirement, next_status, instance_ids)¶
- Parameters:
compute_requirement (
ComputeRequirement
)next_status (
InstanceStatus
)instance_ids (
List
[InstanceId
])
- Return type:
- update_compute_requirement(compute_requirement, reprovision)¶
- Parameters:
compute_requirement (
ComputeRequirement
)reprovision (
bool
)
- update_compute_requirement_template(template)¶
- Parameters:
template (
ComputeRequirementTemplate
)- Return type:
- update_compute_source_template(compute_source_template)¶
- Parameters:
compute_source_template (
ComputeSourceTemplate
)- Return type:
- class yellowdog_client.compute.PredicatedComputeSubscriptionEventListener(future, predicate, compute_client)¶
- Parameters:
future (Future[ComputeRequirement])
predicate (Callable[[ComputeRequirement], bool])
compute_client (ComputeClient)
- subscription_cancelled()¶
Invoked if the server cancels the subscription associated with this listener
- Return type:
- subscription_error(error)¶
Invoked if an error occurs on the subscription associated with this listener.
- updated(obj)¶
Invoked when an updated instance of the object is received from
YellowDog Platform
.- Parameters:
obj (
ComputeRequirement
) – an updated instance of the object for which the listener was registered- Return type: