本文整理匯總了Golang中github.com/aws/aws-sdk-go/private/waiter.Waiter類的典型用法代碼示例。如果您正苦於以下問題:Golang Waiter類的具體用法?Golang Waiter怎麽用?Golang Waiter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Waiter類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: WaitUntilInstanceDeregistered
// WaitUntilInstanceDeregistered uses the Elastic Load Balancing API operation
// DescribeInstanceHealth to wait for a condition to be met before returning.
// If the condition is not meet within the max attempt window an error will
// be returned.
func (c *ELB) WaitUntilInstanceDeregistered(input *DescribeInstanceHealthInput) error {
waiterCfg := waiter.Config{
Operation: "DescribeInstanceHealth",
Delay: 15,
MaxAttempts: 40,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "pathAll",
Argument: "InstanceStates[].State",
Expected: "OutOfService",
},
{
State: "success",
Matcher: "error",
Argument: "",
Expected: "InvalidInstance",
},
},
}
w := waiter.Waiter{
Client: c,
Input: input,
Config: waiterCfg,
}
return w.Wait()
}
示例2: WaitUntilReplicationGroupAvailable
func (c *ElastiCache) WaitUntilReplicationGroupAvailable(input *DescribeReplicationGroupsInput) error {
if waiterReplicationGroupAvailable == nil {
waiterReplicationGroupAvailable = &waiter.Config{
Operation: "DescribeReplicationGroups",
Delay: 15,
MaxAttempts: 40,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "pathAll",
Argument: "ReplicationGroups[].Status",
Expected: "available",
},
{
State: "failure",
Matcher: "pathAny",
Argument: "ReplicationGroups[].Status",
Expected: "deleted",
},
},
}
}
w := waiter.Waiter{
Client: c,
Input: input,
Config: waiterReplicationGroupAvailable,
}
return w.Wait()
}
示例3: WaitUntilSnapshotAvailable
func (c *Redshift) WaitUntilSnapshotAvailable(input *DescribeClusterSnapshotsInput) error {
waiterCfg := waiter.Config{
Operation: "DescribeClusterSnapshots",
Delay: 15,
MaxAttempts: 20,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "pathAll",
Argument: "Snapshots[].Status",
Expected: "available",
},
{
State: "failure",
Matcher: "pathAny",
Argument: "Snapshots[].Status",
Expected: "failed",
},
{
State: "failure",
Matcher: "pathAny",
Argument: "Snapshots[].Status",
Expected: "deleted",
},
},
}
w := waiter.Waiter{
Client: c,
Input: input,
Config: waiterCfg,
}
return w.Wait()
}
示例4: WaitUntilEvaluationAvailable
// WaitUntilEvaluationAvailable uses the Amazon Machine Learning API operation
// DescribeEvaluations to wait for a condition to be met before returning.
// If the condition is not meet within the max attempt window an error will
// be returned.
func (c *MachineLearning) WaitUntilEvaluationAvailable(input *DescribeEvaluationsInput) error {
waiterCfg := waiter.Config{
Operation: "DescribeEvaluations",
Delay: 30,
MaxAttempts: 60,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "pathAll",
Argument: "Results[].Status",
Expected: "COMPLETED",
},
{
State: "failure",
Matcher: "pathAny",
Argument: "Results[].Status",
Expected: "FAILED",
},
},
}
w := waiter.Waiter{
Client: c,
Input: input,
Config: waiterCfg,
}
return w.Wait()
}
示例5: WaitUntilDeploymentSuccessful
func (c *OpsWorks) WaitUntilDeploymentSuccessful(input *DescribeDeploymentsInput) error {
waiterCfg := waiter.Config{
Operation: "DescribeDeployments",
Delay: 15,
MaxAttempts: 40,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "pathAll",
Argument: "Deployments[].Status",
Expected: "successful",
},
{
State: "failure",
Matcher: "pathAny",
Argument: "Deployments[].Status",
Expected: "failed",
},
},
}
w := waiter.Waiter{
Client: c,
Input: input,
Config: waiterCfg,
}
return w.Wait()
}
示例6: WaitUntilTableExists
// WaitUntilTableExists uses the DynamoDB API operation
// DescribeTable to wait for a condition to be met before returning.
// If the condition is not meet within the max attempt window an error will
// be returned.
func (c *DynamoDB) WaitUntilTableExists(input *DescribeTableInput) error {
waiterCfg := waiter.Config{
Operation: "DescribeTable",
Delay: 20,
MaxAttempts: 25,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "path",
Argument: "Table.TableStatus",
Expected: "ACTIVE",
},
{
State: "retry",
Matcher: "error",
Argument: "",
Expected: "ResourceNotFoundException",
},
},
}
w := waiter.Waiter{
Client: c,
Input: input,
Config: waiterCfg,
}
return w.Wait()
}
示例7: WaitUntilTasksRunning
func (c *ECS) WaitUntilTasksRunning(input *DescribeTasksInput) error {
waiterCfg := waiter.Config{
Operation: "DescribeTasks",
Delay: 6,
MaxAttempts: 100,
Acceptors: []waiter.WaitAcceptor{
{
State: "failure",
Matcher: "pathAny",
Argument: "tasks[].lastStatus",
Expected: "STOPPED",
},
{
State: "failure",
Matcher: "pathAny",
Argument: "failures[].reason",
Expected: "MISSING",
},
{
State: "success",
Matcher: "pathAll",
Argument: "tasks[].lastStatus",
Expected: "RUNNING",
},
},
}
w := waiter.Waiter{
Client: c,
Input: input,
Config: waiterCfg,
}
return w.Wait()
}
示例8: WaitUntilNetworkInterfaceAvailable
func (c *EC2) WaitUntilNetworkInterfaceAvailable(input *DescribeNetworkInterfacesInput) error {
waiterCfg := waiter.Config{
Operation: "DescribeNetworkInterfaces",
Delay: 20,
MaxAttempts: 10,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "pathAll",
Argument: "NetworkInterfaces[].Status",
Expected: "available",
},
{
State: "failure",
Matcher: "error",
Argument: "",
Expected: "InvalidNetworkInterfaceIDNotFound",
},
},
}
w := waiter.Waiter{
Client: c,
Input: input,
Config: waiterCfg,
}
return w.Wait()
}
示例9: WaitUntilVolumeDeleted
func (c *EC2) WaitUntilVolumeDeleted(input *DescribeVolumesInput) error {
waiterCfg := waiter.Config{
Operation: "DescribeVolumes",
Delay: 15,
MaxAttempts: 40,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "pathAll",
Argument: "Volumes[].State",
Expected: "deleted",
},
{
State: "success",
Matcher: "error",
Argument: "",
Expected: "InvalidVolumeNotFound",
},
},
}
w := waiter.Waiter{
Client: c,
Input: input,
Config: waiterCfg,
}
return w.Wait()
}
示例10: WaitUntilInstanceTerminated
func (c *EC2) WaitUntilInstanceTerminated(input *DescribeInstancesInput) error {
waiterCfg := waiter.Config{
Operation: "DescribeInstances",
Delay: 15,
MaxAttempts: 40,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "pathAll",
Argument: "Reservations[].Instances[].State.Name",
Expected: "terminated",
},
{
State: "failure",
Matcher: "pathAny",
Argument: "Reservations[].Instances[].State.Name",
Expected: "pending",
},
{
State: "failure",
Matcher: "pathAny",
Argument: "Reservations[].Instances[].State.Name",
Expected: "stopping",
},
},
}
w := waiter.Waiter{
Client: c,
Input: input,
Config: waiterCfg,
}
return w.Wait()
}
示例11: WaitUntilKeyPairExists
func (c *EC2) WaitUntilKeyPairExists(input *DescribeKeyPairsInput) error {
waiterCfg := waiter.Config{
Operation: "DescribeKeyPairs",
Delay: 5,
MaxAttempts: 6,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "pathAll",
Argument: "length(KeyPairs[].KeyName) > `0`",
Expected: true,
},
{
State: "retry",
Matcher: "error",
Argument: "",
Expected: "InvalidKeyPairNotFound",
},
},
}
w := waiter.Waiter{
Client: c,
Input: input,
Config: waiterCfg,
}
return w.Wait()
}
示例12: WaitUntilInstanceStatusOk
func (c *EC2) WaitUntilInstanceStatusOk(input *DescribeInstanceStatusInput) error {
waiterCfg := waiter.Config{
Operation: "DescribeInstanceStatus",
Delay: 15,
MaxAttempts: 40,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "pathAll",
Argument: "InstanceStatuses[].InstanceStatus.Status",
Expected: "ok",
},
{
State: "retry",
Matcher: "error",
Argument: "",
Expected: "InvalidInstanceIDNotFound",
},
},
}
w := waiter.Waiter{
Client: c,
Input: input,
Config: waiterCfg,
}
return w.Wait()
}
示例13: WaitUntilInstanceExists
func (c *EC2) WaitUntilInstanceExists(input *DescribeInstancesInput) error {
waiterCfg := waiter.Config{
Operation: "DescribeInstances",
Delay: 5,
MaxAttempts: 40,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "path",
Argument: "length(Reservations[]) > `0`",
Expected: true,
},
{
State: "retry",
Matcher: "error",
Argument: "",
Expected: "InvalidInstanceIDNotFound",
},
},
}
w := waiter.Waiter{
Client: c,
Input: input,
Config: waiterCfg,
}
return w.Wait()
}
示例14: WaitUntilCustomerGatewayAvailable
func (c *EC2) WaitUntilCustomerGatewayAvailable(input *DescribeCustomerGatewaysInput) error {
waiterCfg := waiter.Config{
Operation: "DescribeCustomerGateways",
Delay: 15,
MaxAttempts: 40,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "pathAll",
Argument: "CustomerGateways[].State",
Expected: "available",
},
{
State: "failure",
Matcher: "pathAny",
Argument: "CustomerGateways[].State",
Expected: "deleted",
},
{
State: "failure",
Matcher: "pathAny",
Argument: "CustomerGateways[].State",
Expected: "deleting",
},
},
}
w := waiter.Waiter{
Client: c,
Input: input,
Config: waiterCfg,
}
return w.Wait()
}
示例15: WaitUntilInstanceProfileExists
func (c *IAM) WaitUntilInstanceProfileExists(input *GetInstanceProfileInput) error {
waiterCfg := waiter.Config{
Operation: "GetInstanceProfile",
Delay: 1,
MaxAttempts: 40,
Acceptors: []waiter.WaitAcceptor{
{
State: "success",
Matcher: "status",
Argument: "",
Expected: 200,
},
{
State: "retry",
Matcher: "status",
Argument: "",
Expected: 404,
},
},
}
w := waiter.Waiter{
Client: c,
Input: input,
Config: waiterCfg,
}
return w.Wait()
}