public interface UpdatableResource<T>
Modifier and Type | Method and Description |
---|---|
TaskResource |
update(String resourceId,
T resource,
RequestOption... options)
Updates the resource identified by
resourceId according to the
provided resource object. |
TaskResource update(String resourceId, T resource, RequestOption... options)
resourceId
according to the
provided resource
object.
Depending on the resource type, the update action can take some time to complete.
Therefore, you can specify a timeout using an implementation of RequestOption
called TaskTimeout
. If no timeout is
specified, the default behavior is to wait until the update action completes.
The following example shows how to specify the timeout:
SomeClient client = oneViewClient.someClient();
SomeResource resource = client.getByName("resourceName");
//do some changes to the resource
TaskResource task = client.update(resource.getResourceId(), resource, TaskTimeout.of(5000)); //5 secs
resourceId
- resource identifier as seen in HPE OneView.resource
- object containing the details of the resource that should be updated.options
- varargs
of RequestOption
, which can be used to specify
some request options.TaskResource
task containing the result of this request.Copyright © 2017. All rights reserved.