public class Hosts extends AbstractCoreBulkResources<HostRestRep> implements TenantResources<HostRestRep>, TaskResources<HostRestRep>
Base URL: /compute/hosts
Constructor and Description |
---|
Hosts(ViPRCoreClient parent,
RestClient client) |
Modifier and Type | Method and Description |
---|---|
Task<HostRestRep> |
create(HostCreateParam input)
Begins creating a host in the given tenant.
|
Task<HostRestRep> |
create(HostCreateParam input,
boolean validateConnection) |
Task<HostRestRep> |
deactivate(java.net.URI id)
Deactivates a host.
|
Task<HostRestRep> |
deactivate(java.net.URI id,
boolean detachStorage)
Deactivates a host.
|
Task<HostRestRep> |
deactivate(java.net.URI id,
boolean detachStorage,
boolean deactivateBootVolume)
Deactivates a host.
|
Task<HostRestRep> |
detachStorage(java.net.URI id)
Detaches storage from a host.
|
Task<HostRestRep> |
discover(java.net.URI id)
Begins discovery of the given host by ID.
|
Tasks<HostRestRep> |
discoverHostArrayAffinity(ArrayAffinityHostParam param)
Begins discovery of array affinity information on all supported arrays for the given host IDs.
|
java.util.List<HostRestRep> |
getByCluster(java.net.URI clusterId)
Gets the list of hosts in the given cluster.
|
java.util.List<HostRestRep> |
getByDataCenter(java.net.URI dataCenterId)
Gets the list of hosts in the given datacenter.
|
java.util.List<HostRestRep> |
getByDataCenter(java.net.URI dataCenterId,
ResourceFilter<HostRestRep> filter)
Gets the list of hosts in a given datacenter, optionally filtering the results.
|
java.util.List<HostRestRep> |
getByTenant(java.net.URI tenantId)
Gets the resources associated with a given tenant.
|
java.util.List<HostRestRep> |
getByTenant(java.net.URI tenantId,
ResourceFilter<HostRestRep> filter)
Gets the resources associated with a given tenant, optionally filtering the results as they are returned.
|
java.util.List<HostRestRep> |
getByUserTenant()
Convenience method for retrieving by user's current tenant.
|
java.util.List<HostRestRep> |
getByUserTenant(ResourceFilter<HostRestRep> filter)
Convenience method for retrieving by user's current tenant.
|
Task<HostRestRep> |
getTask(java.net.URI id,
java.net.URI taskId)
Gets a single task associated with a given resource by ID.
|
Tasks<HostRestRep> |
getTasks(java.net.URI id)
Gets the tasks associated with a given resource by ID.
|
java.util.List<NamedRelatedResourceRep> |
listByCluster(java.net.URI clusterId)
Lists the hosts in the given cluster.
|
java.util.List<NamedRelatedResourceRep> |
listByDataCenter(java.net.URI dataCenterId)
Lists the hosts in the given datacenter.
|
java.util.List<NamedRelatedResourceRep> |
listByTenant(java.net.URI tenantId)
Lists the hosts by tenant.
|
java.util.List<NamedRelatedResourceRep> |
listByUserTenant()
Convenience method for listing by the user's current tenant.
|
Task<HostRestRep> |
osInstall(java.net.URI id,
OsInstallParam input)
Install OS on the given host.
|
Tasks<HostRestRep> |
provisionBareMetalHosts(ProvisionBareMetalHostsParam param)
Provision bare metal hosts.
|
Task<HostRestRep> |
update(java.net.URI id,
HostUpdateParam input)
Begins updating a host.
|
Task<HostRestRep> |
update(java.net.URI id,
HostUpdateParam input,
boolean validateConnection) |
Task<HostRestRep> |
update(java.net.URI id,
HostUpdateParam input,
boolean validateConnection,
boolean updateExports)
Updates a host by ID.
|
Hosts |
withInactive(boolean inactive)
Configures the fetch operations to include inactive resources.
|
Hosts |
withInternal(boolean internal)
Configures the fetch operations to include internal resources.
|
getByIds, getByRefs, listBulkIds
addTags, get, get, getByIds, getByRefs, getTags, performSearch, performSearchBy, removeTags, search, updateTags
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getByIds, getByRefs
addTags, get, get, getTags, removeTags, search, updateTags
public Hosts(ViPRCoreClient parent, RestClient client)
public Hosts withInactive(boolean inactive)
AbstractResources
withInactive
in class AbstractResources<HostRestRep>
inactive
- whether to include inactive resources.public Hosts withInternal(boolean internal)
AbstractResources
withInternal
in class AbstractResources<HostRestRep>
internal
- whether to include internal resources.public Tasks<HostRestRep> getTasks(java.net.URI id)
TaskResources
API Call: GET baseUrl/{id}/tasks
getTasks
in interface TaskResources<HostRestRep>
id
- the resource ID.public Task<HostRestRep> getTask(java.net.URI id, java.net.URI taskId)
TaskResources
API Call: GET baseUrl/{id}/tasks/{taskId}
getTask
in interface TaskResources<HostRestRep>
id
- the resource ID.taskId
- the task ID.public java.util.List<NamedRelatedResourceRep> listByTenant(java.net.URI tenantId)
API Call: GET /compute/hosts?tenant={tenantId}
listByTenant
in interface TenantResources<HostRestRep>
tenantId
- the ID of the tenant.public java.util.List<NamedRelatedResourceRep> listByUserTenant()
TenantResources
Equivalent to: listByTenant(client.getUserTenant())
listByUserTenant
in interface TenantResources<HostRestRep>
TenantResources.listByTenant(URI)
public java.util.List<HostRestRep> getByTenant(java.net.URI tenantId)
TenantResources
getByTenant
in interface TenantResources<HostRestRep>
tenantId
- the tenant ID.Resources.getByRefs(java.util.Collection)
public java.util.List<HostRestRep> getByUserTenant()
TenantResources
Equivalent to: getByTenant(client.getUserTenant())
getByUserTenant
in interface TenantResources<HostRestRep>
TenantResources.getByTenant(URI)
public java.util.List<HostRestRep> getByUserTenant(ResourceFilter<HostRestRep> filter)
TenantResources
Equivalent to: getByTenant(client.getUserTenant(), filter)
getByUserTenant
in interface TenantResources<HostRestRep>
TenantResources.getByTenant(URI, ResourceFilter)
public java.util.List<HostRestRep> getByTenant(java.net.URI tenantId, ResourceFilter<HostRestRep> filter)
TenantResources
getByTenant
in interface TenantResources<HostRestRep>
tenantId
- the tenant ID.filter
- the resource filter to apply to the results as they are returned (optional).Resources.getByRefs(java.util.Collection, ResourceFilter)
public java.util.List<NamedRelatedResourceRep> listByDataCenter(java.net.URI dataCenterId)
API Call: GET /compute/vcenter-data-centers/{dataCenterId}/hosts
dataCenterId
- the ID of the datacenter.public java.util.List<HostRestRep> getByDataCenter(java.net.URI dataCenterId)
dataCenterId
- the ID of the datacenter.public java.util.List<HostRestRep> getByDataCenter(java.net.URI dataCenterId, ResourceFilter<HostRestRep> filter)
dataCenterId
- the ID of the datacenter.filter
- the resource filter to apply to the results as they are returned (optional).public java.util.List<NamedRelatedResourceRep> listByCluster(java.net.URI clusterId)
API Call: GET /compute/clusters/{clusterId}/hosts
clusterId
- the ID of the cluster.public java.util.List<HostRestRep> getByCluster(java.net.URI clusterId)
clusterId
- the ID of the cluster.public Task<HostRestRep> create(HostCreateParam input)
API Call: POST /compute/hosts
input
- the create configuration.public Task<HostRestRep> create(HostCreateParam input, boolean validateConnection)
public Task<HostRestRep> update(java.net.URI id, HostUpdateParam input)
API Call: PUT /compute/hosts/{id}
id
- the ID of the host.input
- the update configuration.public Task<HostRestRep> update(java.net.URI id, HostUpdateParam input, boolean validateConnection, boolean updateExports)
API Call: PUT /compute/hosts/{id}?validate_connection={validateConnection}&update_exports={updateExports}
id
- the ID of the host to update.input
- the update configuration.validateConnection
- if true, also validate the host connectionupdateExports
- if true, will also update host exports.public Task<HostRestRep> update(java.net.URI id, HostUpdateParam input, boolean validateConnection)
public Task<HostRestRep> deactivate(java.net.URI id)
API Call: POST /compute/hosts/{id}/deactivate
id
- the ID of the host.public Task<HostRestRep> deactivate(java.net.URI id, boolean detachStorage)
API Call: POST /compute/hosts/{id}/deactivate?detach_storage={detachStorage}
id
- the ID of the host to deactivate.detachStorage
- if true, will first detach storage.public Task<HostRestRep> deactivate(java.net.URI id, boolean detachStorage, boolean deactivateBootVolume)
API Call: POST /compute/hosts/{id}/deactivate?detach_storage={detachStorage} deactivate_boot_volume={deactivateBootVolume}
id
- the ID of the host to deactivate.detachStorage
- if true, will first detach storage.deactivateBootVolume
- if true, and if the host was provisioned by ViPR the associated boot volume (if exists) will be deactivatedpublic Task<HostRestRep> detachStorage(java.net.URI id)
API Call: POST /compute/hosts/{id}/detach-storage
id
- the ID of the host.public Task<HostRestRep> discover(java.net.URI id)
API Call: POST /compute/hosts/{id}/discover
id
- the ID of the host to discover.public Tasks<HostRestRep> discoverHostArrayAffinity(ArrayAffinityHostParam param)
API Call: POST /compute/hosts/discover-array-affinity
param
- ArrayAffinityHostParam containing host IDs.public Tasks<HostRestRep> provisionBareMetalHosts(ProvisionBareMetalHostsParam param)
API Call: POST /compute/hosts/provision-bare-metal
public Task<HostRestRep> osInstall(java.net.URI id, OsInstallParam input)
API Call: PUT /compute/hosts/{id}/os-install
id
- the ID of the host to install OS on.input
- the OS install information.