public interface CreatableResource<T>
Modifier and Type | Method and Description |
---|---|
TaskResource |
create(T resource,
RequestOption... options)
Creates a resource according to the provided
resource object. |
TaskResource create(T resource, RequestOption... options)
resource
object.
Depending on the resource type, the create 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 create action completes.
The following example shows how to specify the timeout:
SomeClient client = oneViewClient.someClient();
SomeResource resource = new SomeResource();
TaskResource task = client.create(resource, TaskTimeout.of(5000)); //5 secs
resource
- object containing the details of the resource that should be created.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.