本文整理汇总了Golang中github.com/upstartmobile/aws-sdk-go/service/iot.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: init
func init() {
Before("@iotdataplane", func() {
svc := iot.New(nil)
result, err := svc.DescribeEndpoint(&iot.DescribeEndpointInput{})
if err != nil {
World["error"] = err
return
}
World["client"] = iotdataplane.New(aws.NewConfig().
WithEndpoint(*result.EndpointAddress))
})
}
示例2: ExampleIoT_GetLoggingOptions
func ExampleIoT_GetLoggingOptions() {
svc := iot.New(nil)
var params *iot.GetLoggingOptionsInput
resp, err := svc.GetLoggingOptions(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例3: ExampleIoT_DescribeEndpoint
func ExampleIoT_DescribeEndpoint() {
svc := iot.New(nil)
var params *iot.DescribeEndpointInput
resp, err := svc.DescribeEndpoint(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例4: ExampleIoT_CancelCertificateTransfer
func ExampleIoT_CancelCertificateTransfer() {
svc := iot.New(nil)
params := &iot.CancelCertificateTransferInput{
CertificateId: aws.String("CertificateId"), // Required
}
resp, err := svc.CancelCertificateTransfer(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例5: ExampleIoT_ListThingPrincipals
func ExampleIoT_ListThingPrincipals() {
svc := iot.New(nil)
params := &iot.ListThingPrincipalsInput{
ThingName: aws.String("ThingName"), // Required
}
resp, err := svc.ListThingPrincipals(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例6: ExampleIoT_GetTopicRule
func ExampleIoT_GetTopicRule() {
svc := iot.New(nil)
params := &iot.GetTopicRuleInput{
RuleName: aws.String("RuleName"), // Required
}
resp, err := svc.GetTopicRule(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例7: ExampleIoT_CreateKeysAndCertificate
func ExampleIoT_CreateKeysAndCertificate() {
svc := iot.New(nil)
params := &iot.CreateKeysAndCertificateInput{
SetAsActive: aws.Bool(true),
}
resp, err := svc.CreateKeysAndCertificate(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例8: ExampleIoT_SetDefaultPolicyVersion
func ExampleIoT_SetDefaultPolicyVersion() {
svc := iot.New(nil)
params := &iot.SetDefaultPolicyVersionInput{
PolicyName: aws.String("PolicyName"), // Required
PolicyVersionId: aws.String("PolicyVersionId"), // Required
}
resp, err := svc.SetDefaultPolicyVersion(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例9: ExampleIoT_DetachPrincipalPolicy
func ExampleIoT_DetachPrincipalPolicy() {
svc := iot.New(nil)
params := &iot.DetachPrincipalPolicyInput{
PolicyName: aws.String("PolicyName"), // Required
Principal: aws.String("Principal"), // Required
}
resp, err := svc.DetachPrincipalPolicy(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例10: ExampleIoT_CreateCertificateFromCsr
func ExampleIoT_CreateCertificateFromCsr() {
svc := iot.New(nil)
params := &iot.CreateCertificateFromCsrInput{
CertificateSigningRequest: aws.String("CertificateSigningRequest"), // Required
SetAsActive: aws.Bool(true),
}
resp, err := svc.CreateCertificateFromCsr(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例11: ExampleIoT_CreatePolicyVersion
func ExampleIoT_CreatePolicyVersion() {
svc := iot.New(nil)
params := &iot.CreatePolicyVersionInput{
PolicyDocument: aws.String("PolicyDocument"), // Required
PolicyName: aws.String("PolicyName"), // Required
SetAsDefault: aws.Bool(true),
}
resp, err := svc.CreatePolicyVersion(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例12: ExampleIoT_ListPrincipalThings
func ExampleIoT_ListPrincipalThings() {
svc := iot.New(nil)
params := &iot.ListPrincipalThingsInput{
Principal: aws.String("Principal"), // Required
MaxResults: aws.Int64(1),
NextToken: aws.String("NextToken"),
}
resp, err := svc.ListPrincipalThings(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例13: ExampleIoT_ListPolicies
func ExampleIoT_ListPolicies() {
svc := iot.New(nil)
params := &iot.ListPoliciesInput{
AscendingOrder: aws.Bool(true),
Marker: aws.String("Marker"),
PageSize: aws.Int64(1),
}
resp, err := svc.ListPolicies(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例14: ExampleIoT_SetLoggingOptions
func ExampleIoT_SetLoggingOptions() {
svc := iot.New(nil)
params := &iot.SetLoggingOptionsInput{
LoggingOptionsPayload: &iot.LoggingOptionsPayload{
RoleArn: aws.String("AwsArn"), // Required
LogLevel: aws.String("LogLevel"),
},
}
resp, err := svc.SetLoggingOptions(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例15: ExampleIoT_ListTopicRules
func ExampleIoT_ListTopicRules() {
svc := iot.New(nil)
params := &iot.ListTopicRulesInput{
MaxResults: aws.Int64(1),
NextToken: aws.String("NextToken"),
RuleDisabled: aws.Bool(true),
Topic: aws.String("Topic"),
}
resp, err := svc.ListTopicRules(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}