public class Operation extends Object implements Serializable
operationId().
operationId() returns GlobalOperationId for global operations,
RegionOperationId for region operations, and ZoneOperationId for zone operations.
To get an Operation object with the most recent information, use
#reload(OperationOption...).| Modifier and Type | Class and Description |
|---|---|
static class |
Operation.OperationError
An error that can occur during the processing of a Google Compute Engine operation.
|
static class |
Operation.OperationWarning
A warning message that is generated during the processing of a Google Compute Engine operation.
|
static class |
Operation.Status
Status of an operation.
|
| Modifier and Type | Method and Description |
|---|---|
Compute |
compute()
Returns the operation's
Compute object used to issue requests. |
boolean |
delete()
Deletes this operation.
|
String |
description()
Returns an optional textual description of the operation.
|
Long |
endTime()
Returns the time that this operation was completed.
|
boolean |
equals(Object obj) |
List<Operation.OperationError> |
errors()
Returns the errors encountered while processing this operation, if any.
|
boolean |
exists()
Checks if this operation exists.
|
String |
generatedId()
Returns the service-generated unique identifier for the operation.
|
int |
hashCode() |
String |
httpErrorMessage()
Returns the the HTTP error message that was returned, if the operation failed.
|
Integer |
httpErrorStatusCode()
Returns the HTTP error status code that was returned, if the operation failed.
|
Long |
insertTime()
Returns the time that this operation was requested.
|
boolean |
isDone()
Checks if this operation has completed its execution, either failing or succeeding.
|
<T extends OperationId> |
operationId()
Returns the operation's identity.
|
String |
operationType()
Returns the type of operation.
|
Integer |
progress()
Returns an optional progress indicator that ranges from 0 to 100.
|
Operation |
reload(Compute.OperationOption... options)
Fetches current operation's latest information.
|
Long |
startTime()
Returns the time that this operation was started by the service.
|
Operation.Status |
status()
Returns the status of the operation.
|
String |
statusMessage()
Returns an optional textual description of the current status of the operation.
|
String |
targetId()
Returns the unique service-defined target ID, which identifies the resource that the operation
is modifying.
|
String |
targetLink()
Returns the URL of the resource that the operation is modifying.
|
String |
toString() |
String |
user()
Returns the user who requested the operation, for example:
user@example.com. |
List<Operation.OperationWarning> |
warnings()
Returns the warnings encountered while processing this operation, if any.
|
public Compute compute()
Compute object used to issue requests.public String generatedId()
public <T extends OperationId> T operationId()
GlobalOperationId for global
operations, a RegionOperationId for region operations and a ZoneOperationId for
zone operations.public String operationType()
public String targetLink()
public String targetId()
public Operation.Status status()
public String statusMessage()
public String user()
user@example.com.public Integer progress()
public Long insertTime()
public Long startTime()
null if the operation has not started yet.public Long endTime()
null if the operation has not finished yet.public List<Operation.OperationError> errors()
null if
no error occurred.public List<Operation.OperationWarning> warnings()
null
if no warning occurred.public Integer httpErrorStatusCode()
404 means the resource was not found.public String httpErrorMessage()
NOT FOUND message is returned if the resource was not found.public String description()
public boolean exists()
throws ComputeException
true if this operation exists, false otherwiseComputeException - upon failurepublic boolean isDone()
throws ComputeException
true. You can wait for operation
completion with:
while(!operation.isDone()) {
Thread.sleep(1000L);
}true if this operation is in Operation.Status.DONE state or if it does
not exist, false if the state is not Operation.Status.DONEComputeException - upon failurepublic Operation reload(Compute.OperationOption... options) throws ComputeException
null if the operation does not
exist.options - operation optionsOperation object with latest information or null if not foundComputeException - upon failurepublic boolean delete()
throws ComputeException
true if operation was deleted, false if it was not foundComputeException - upon failureCopyright © 2016 Google. All rights reserved.