本文整理汇总了Golang中bosun/org/_third_party/github.com/awslabs/aws-sdk-go/aws/awsutil.StringValue函数的典型用法代码示例。如果您正苦于以下问题:Golang StringValue函数的具体用法?Golang StringValue怎么用?Golang StringValue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了StringValue函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: ExampleCloudWatch_ListMetrics
func ExampleCloudWatch_ListMetrics() {
svc := cloudwatch.New(nil)
params := &cloudwatch.ListMetricsInput{
Dimensions: []*cloudwatch.DimensionFilter{
&cloudwatch.DimensionFilter{ // Required
Name: aws.String("DimensionName"), // Required
Value: aws.String("DimensionValue"),
},
// More values...
},
MetricName: aws.String("MetricName"),
Namespace: aws.String("Namespace"),
NextToken: aws.String("NextToken"),
}
resp, err := svc.ListMetrics(params)
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
fmt.Println(err.Error())
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例2: ExampleELB_ConfigureHealthCheck
func ExampleELB_ConfigureHealthCheck() {
svc := elb.New(nil)
params := &elb.ConfigureHealthCheckInput{
HealthCheck: &elb.HealthCheck{ // Required
HealthyThreshold: aws.Long(1), // Required
Interval: aws.Long(1), // Required
Target: aws.String("HealthCheckTarget"), // Required
Timeout: aws.Long(1), // Required
UnhealthyThreshold: aws.Long(1), // Required
},
LoadBalancerName: aws.String("AccessPointName"), // Required
}
resp, err := svc.ConfigureHealthCheck(params)
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
fmt.Println(err.Error())
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例3: ExampleELB_SetLoadBalancerPoliciesOfListener
func ExampleELB_SetLoadBalancerPoliciesOfListener() {
svc := elb.New(nil)
params := &elb.SetLoadBalancerPoliciesOfListenerInput{
LoadBalancerName: aws.String("AccessPointName"), // Required
LoadBalancerPort: aws.Long(1), // Required
PolicyNames: []*string{ // Required
aws.String("PolicyName"), // Required
// More values...
},
}
resp, err := svc.SetLoadBalancerPoliciesOfListener(params)
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
fmt.Println(err.Error())
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例4: ExampleELB_RemoveTags
func ExampleELB_RemoveTags() {
svc := elb.New(nil)
params := &elb.RemoveTagsInput{
LoadBalancerNames: []*string{ // Required
aws.String("AccessPointName"), // Required
// More values...
},
Tags: []*elb.TagKeyOnly{ // Required
&elb.TagKeyOnly{ // Required
Key: aws.String("TagKey"),
},
// More values...
},
}
resp, err := svc.RemoveTags(params)
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
fmt.Println(err.Error())
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例5: ExampleCloudWatch_DescribeAlarmsForMetric
func ExampleCloudWatch_DescribeAlarmsForMetric() {
svc := cloudwatch.New(nil)
params := &cloudwatch.DescribeAlarmsForMetricInput{
MetricName: aws.String("MetricName"), // Required
Namespace: aws.String("Namespace"), // Required
Dimensions: []*cloudwatch.Dimension{
&cloudwatch.Dimension{ // Required
Name: aws.String("DimensionName"), // Required
Value: aws.String("DimensionValue"), // Required
},
// More values...
},
Period: aws.Long(1),
Statistic: aws.String("Statistic"),
Unit: aws.String("StandardUnit"),
}
resp, err := svc.DescribeAlarmsForMetric(params)
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
fmt.Println(err.Error())
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例6: ExampleELB_CreateLoadBalancerPolicy
func ExampleELB_CreateLoadBalancerPolicy() {
svc := elb.New(nil)
params := &elb.CreateLoadBalancerPolicyInput{
LoadBalancerName: aws.String("AccessPointName"), // Required
PolicyName: aws.String("PolicyName"), // Required
PolicyTypeName: aws.String("PolicyTypeName"), // Required
PolicyAttributes: []*elb.PolicyAttribute{
&elb.PolicyAttribute{ // Required
AttributeName: aws.String("AttributeName"),
AttributeValue: aws.String("AttributeValue"),
},
// More values...
},
}
resp, err := svc.CreateLoadBalancerPolicy(params)
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
fmt.Println(err.Error())
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例7: ExampleELB_RegisterInstancesWithLoadBalancer
func ExampleELB_RegisterInstancesWithLoadBalancer() {
svc := elb.New(nil)
params := &elb.RegisterInstancesWithLoadBalancerInput{
Instances: []*elb.Instance{ // Required
&elb.Instance{ // Required
InstanceID: aws.String("InstanceId"),
},
// More values...
},
LoadBalancerName: aws.String("AccessPointName"), // Required
}
resp, err := svc.RegisterInstancesWithLoadBalancer(params)
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
fmt.Println(err.Error())
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例8: ExampleELB_DescribeLoadBalancerPolicyTypes
func ExampleELB_DescribeLoadBalancerPolicyTypes() {
svc := elb.New(nil)
params := &elb.DescribeLoadBalancerPolicyTypesInput{
PolicyTypeNames: []*string{
aws.String("PolicyTypeName"), // Required
// More values...
},
}
resp, err := svc.DescribeLoadBalancerPolicyTypes(params)
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
fmt.Println(err.Error())
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例9: ExampleCloudWatch_DescribeAlarms
func ExampleCloudWatch_DescribeAlarms() {
svc := cloudwatch.New(nil)
params := &cloudwatch.DescribeAlarmsInput{
ActionPrefix: aws.String("ActionPrefix"),
AlarmNamePrefix: aws.String("AlarmNamePrefix"),
AlarmNames: []*string{
aws.String("AlarmName"), // Required
// More values...
},
MaxRecords: aws.Long(1),
NextToken: aws.String("NextToken"),
StateValue: aws.String("StateValue"),
}
resp, err := svc.DescribeAlarms(params)
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
fmt.Println(err.Error())
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例10: ExampleELB_CreateLoadBalancerListeners
func ExampleELB_CreateLoadBalancerListeners() {
svc := elb.New(nil)
params := &elb.CreateLoadBalancerListenersInput{
Listeners: []*elb.Listener{ // Required
&elb.Listener{ // Required
InstancePort: aws.Long(1), // Required
LoadBalancerPort: aws.Long(1), // Required
Protocol: aws.String("Protocol"), // Required
InstanceProtocol: aws.String("Protocol"),
SSLCertificateID: aws.String("SSLCertificateId"),
},
// More values...
},
LoadBalancerName: aws.String("AccessPointName"), // Required
}
resp, err := svc.CreateLoadBalancerListeners(params)
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
fmt.Println(err.Error())
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例11: ExampleCloudWatch_EnableAlarmActions
func ExampleCloudWatch_EnableAlarmActions() {
svc := cloudwatch.New(nil)
params := &cloudwatch.EnableAlarmActionsInput{
AlarmNames: []*string{ // Required
aws.String("AlarmName"), // Required
// More values...
},
}
resp, err := svc.EnableAlarmActions(params)
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
fmt.Println(err.Error())
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例12: ExampleCloudWatch_DescribeAlarmHistory
func ExampleCloudWatch_DescribeAlarmHistory() {
svc := cloudwatch.New(nil)
params := &cloudwatch.DescribeAlarmHistoryInput{
AlarmName: aws.String("AlarmName"),
EndDate: aws.Time(time.Now()),
HistoryItemType: aws.String("HistoryItemType"),
MaxRecords: aws.Long(1),
NextToken: aws.String("NextToken"),
StartDate: aws.Time(time.Now()),
}
resp, err := svc.DescribeAlarmHistory(params)
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
fmt.Println(err.Error())
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例13: ExampleCloudWatch_SetAlarmState
func ExampleCloudWatch_SetAlarmState() {
svc := cloudwatch.New(nil)
params := &cloudwatch.SetAlarmStateInput{
AlarmName: aws.String("AlarmName"), // Required
StateReason: aws.String("StateReason"), // Required
StateValue: aws.String("StateValue"), // Required
StateReasonData: aws.String("StateReasonData"),
}
resp, err := svc.SetAlarmState(params)
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
fmt.Println(err.Error())
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例14: ExampleCloudWatch_PutMetricAlarm
func ExampleCloudWatch_PutMetricAlarm() {
svc := cloudwatch.New(nil)
params := &cloudwatch.PutMetricAlarmInput{
AlarmName: aws.String("AlarmName"), // Required
ComparisonOperator: aws.String("ComparisonOperator"), // Required
EvaluationPeriods: aws.Long(1), // Required
MetricName: aws.String("MetricName"), // Required
Namespace: aws.String("Namespace"), // Required
Period: aws.Long(1), // Required
Statistic: aws.String("Statistic"), // Required
Threshold: aws.Double(1.0), // Required
ActionsEnabled: aws.Boolean(true),
AlarmActions: []*string{
aws.String("ResourceName"), // Required
// More values...
},
AlarmDescription: aws.String("AlarmDescription"),
Dimensions: []*cloudwatch.Dimension{
&cloudwatch.Dimension{ // Required
Name: aws.String("DimensionName"), // Required
Value: aws.String("DimensionValue"), // Required
},
// More values...
},
InsufficientDataActions: []*string{
aws.String("ResourceName"), // Required
// More values...
},
OKActions: []*string{
aws.String("ResourceName"), // Required
// More values...
},
Unit: aws.String("StandardUnit"),
}
resp, err := svc.PutMetricAlarm(params)
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
fmt.Println(err.Error())
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例15: ExampleELB_ModifyLoadBalancerAttributes
func ExampleELB_ModifyLoadBalancerAttributes() {
svc := elb.New(nil)
params := &elb.ModifyLoadBalancerAttributesInput{
LoadBalancerAttributes: &elb.LoadBalancerAttributes{ // Required
AccessLog: &elb.AccessLog{
Enabled: aws.Boolean(true), // Required
EmitInterval: aws.Long(1),
S3BucketName: aws.String("S3BucketName"),
S3BucketPrefix: aws.String("AccessLogPrefix"),
},
AdditionalAttributes: []*elb.AdditionalAttribute{
&elb.AdditionalAttribute{ // Required
Key: aws.String("StringVal"),
Value: aws.String("StringVal"),
},
// More values...
},
ConnectionDraining: &elb.ConnectionDraining{
Enabled: aws.Boolean(true), // Required
Timeout: aws.Long(1),
},
ConnectionSettings: &elb.ConnectionSettings{
IdleTimeout: aws.Long(1), // Required
},
CrossZoneLoadBalancing: &elb.CrossZoneLoadBalancing{
Enabled: aws.Boolean(true), // Required
},
},
LoadBalancerName: aws.String("AccessPointName"), // Required
}
resp, err := svc.ModifyLoadBalancerAttributes(params)
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
fmt.Println(err.Error())
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}