當前位置: 首頁>>代碼示例>>Golang>>正文


Golang waiter.Waiter類代碼示例

本文整理匯總了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()
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:32,代碼來源:waiters.go

示例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()
}
開發者ID:rlcomte,項目名稱:aws-sdk-go,代碼行數:30,代碼來源:waiters.go

示例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()
}
開發者ID:acquia,項目名稱:fifo2kinesis,代碼行數:34,代碼來源:waiters.go

示例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()
}
開發者ID:xibz,項目名稱:aws-sdk-go,代碼行數:32,代碼來源:waiters.go

示例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()
}
開發者ID:ColourboxDevelopment,項目名稱:aws-sdk-go,代碼行數:28,代碼來源:waiters.go

示例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()
}
開發者ID:xibz,項目名稱:aws-sdk-go,代碼行數:32,代碼來源:waiters.go

示例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()
}
開發者ID:acquia,項目名稱:fifo2kinesis,代碼行數:34,代碼來源:waiters.go

示例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()
}
開發者ID:discogestalt,項目名稱:terraform,代碼行數:28,代碼來源:waiters.go

示例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()
}
開發者ID:discogestalt,項目名稱:terraform,代碼行數:28,代碼來源:waiters.go

示例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()
}
開發者ID:discogestalt,項目名稱:terraform,代碼行數:34,代碼來源:waiters.go

示例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()
}
開發者ID:discogestalt,項目名稱:terraform,代碼行數:28,代碼來源:waiters.go

示例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()
}
開發者ID:discogestalt,項目名稱:terraform,代碼行數:28,代碼來源:waiters.go

示例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()
}
開發者ID:discogestalt,項目名稱:terraform,代碼行數:28,代碼來源:waiters.go

示例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()
}
開發者ID:discogestalt,項目名稱:terraform,代碼行數:34,代碼來源:waiters.go

示例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()
}
開發者ID:ColourboxDevelopment,項目名稱:aws-sdk-go,代碼行數:28,代碼來源:waiters.go


注:本文中的github.com/aws/aws-sdk-go/private/waiter.Waiter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。