- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
GetOperationCommand
Gets information about any operation that returns an operation ID in the response, such as a CreateHttpNamespace
request.
To get a list of operations that match specified criteria, see ListOperations .
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { ServiceDiscoveryClient, GetOperationCommand } from "@aws-sdk/client-servicediscovery"; // ES Modules import
// const { ServiceDiscoveryClient, GetOperationCommand } = require("@aws-sdk/client-servicediscovery"); // CommonJS import
const client = new ServiceDiscoveryClient(config);
const input = { // GetOperationRequest
OperationId: "STRING_VALUE", // required
};
const command = new GetOperationCommand(input);
const response = await client.send(command);
// { // GetOperationResponse
// Operation: { // Operation
// Id: "STRING_VALUE",
// Type: "CREATE_NAMESPACE" || "DELETE_NAMESPACE" || "UPDATE_NAMESPACE" || "UPDATE_SERVICE" || "REGISTER_INSTANCE" || "DEREGISTER_INSTANCE",
// Status: "SUBMITTED" || "PENDING" || "SUCCESS" || "FAIL",
// ErrorMessage: "STRING_VALUE",
// ErrorCode: "STRING_VALUE",
// CreateDate: new Date("TIMESTAMP"),
// UpdateDate: new Date("TIMESTAMP"),
// Targets: { // OperationTargetsMap
// "<keys>": "STRING_VALUE",
// },
// },
// };
Example Usage
There was an error loading the code editor. Retry
GetOperationCommand Input
See GetOperationCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
OperationId Required | string | undefined | The ID of the operation that you want to get more information about. |
GetOperationCommand Output
See GetOperationCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Operation | Operation | undefined | A complex type that contains information about the operation. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidInput | client | One or more specified values aren't valid. For example, a required value might be missing, a numeric value might be outside the allowed range, or a string value might exceed length constraints. |
OperationNotFound | client | No operation exists with the specified ID. |
ServiceDiscoveryServiceException | Base exception class for all service exceptions from ServiceDiscovery service. |