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


Golang route53.New函數代碼示例

本文整理匯總了Golang中github.com/aws/aws-sdk-go/service/route53.New函數的典型用法代碼示例。如果您正苦於以下問題:Golang New函數的具體用法?Golang New怎麽用?Golang New使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了New函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: ExampleRoute53_ListGeoLocations

func ExampleRoute53_ListGeoLocations() {
	svc := route53.New(nil)

	params := &route53.ListGeoLocationsInput{
		MaxItems:             aws.String("PageMaxItems"),
		StartContinentCode:   aws.String("GeoLocationContinentCode"),
		StartCountryCode:     aws.String("GeoLocationCountryCode"),
		StartSubdivisionCode: aws.String("GeoLocationSubdivisionCode"),
	}
	resp, err := svc.ListGeoLocations(params)

	if err != nil {
		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 {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
開發者ID:Talos208,項目名稱:aws-sdk-go,代碼行數:29,代碼來源:examples_test.go

示例2: ExampleRoute53_ListReusableDelegationSets

func ExampleRoute53_ListReusableDelegationSets() {
	svc := route53.New(nil)

	params := &route53.ListReusableDelegationSetsInput{
		Marker:   aws.String("PageMarker"),
		MaxItems: aws.String("PageMaxItems"),
	}
	resp, err := svc.ListReusableDelegationSets(params)

	if err != nil {
		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 {
			// This case should never be hit, The SDK should alwsy return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
開發者ID:yourchanges,項目名稱:empire,代碼行數:27,代碼來源:examples_test.go

示例3: ExampleRoute53_UpdateHealthCheck

func ExampleRoute53_UpdateHealthCheck() {
	svc := route53.New(nil)

	params := &route53.UpdateHealthCheckInput{
		HealthCheckID:            aws.String("HealthCheckId"), // Required
		FailureThreshold:         aws.Long(1),
		FullyQualifiedDomainName: aws.String("FullyQualifiedDomainName"),
		HealthCheckVersion:       aws.Long(1),
		IPAddress:                aws.String("IPAddress"),
		Port:                     aws.Long(1),
		ResourcePath:             aws.String("ResourcePath"),
		SearchString:             aws.String("SearchString"),
	}
	resp, err := svc.UpdateHealthCheck(params)

	if err != nil {
		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 {
			// This case should never be hit, The SDK should alwsy return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
開發者ID:yourchanges,項目名稱:empire,代碼行數:33,代碼來源:examples_test.go

示例4: ExampleRoute53_UpdateHealthCheck

func ExampleRoute53_UpdateHealthCheck() {
	svc := route53.New(session.New())

	params := &route53.UpdateHealthCheckInput{
		HealthCheckId: aws.String("HealthCheckId"), // Required
		ChildHealthChecks: []*string{
			aws.String("HealthCheckId"), // Required
			// More values...
		},
		FailureThreshold:         aws.Int64(1),
		FullyQualifiedDomainName: aws.String("FullyQualifiedDomainName"),
		HealthCheckVersion:       aws.Int64(1),
		HealthThreshold:          aws.Int64(1),
		IPAddress:                aws.String("IPAddress"),
		Inverted:                 aws.Bool(true),
		Port:                     aws.Int64(1),
		ResourcePath:             aws.String("ResourcePath"),
		SearchString:             aws.String("SearchString"),
	}
	resp, err := svc.UpdateHealthCheck(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)
}
開發者ID:frewsxcv,項目名稱:empire,代碼行數:31,代碼來源:examples_test.go

示例5: ExampleRoute53_GetHealthCheckLastFailureReason

func ExampleRoute53_GetHealthCheckLastFailureReason() {
	svc := route53.New(nil)

	params := &route53.GetHealthCheckLastFailureReasonInput{
		HealthCheckID: aws.String("HealthCheckId"), // Required
	}
	resp, err := svc.GetHealthCheckLastFailureReason(params)

	if err != nil {
		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 {
			// This case should never be hit, The SDK should alwsy return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
開發者ID:yourchanges,項目名稱:empire,代碼行數:26,代碼來源:examples_test.go

示例6: CreateRecord

// CreateRecord for hosted zone id
func CreateRecord(zone string, record string, dest string) error {
	svc := route53.New(session.New(), aws.NewConfig())
	_, err := svc.ChangeResourceRecordSets(&route53.ChangeResourceRecordSetsInput{
		ChangeBatch: &route53.ChangeBatch{
			Changes: []*route53.Change{
				{
					Action: aws.String("CREATE"),
					ResourceRecordSet: &route53.ResourceRecordSet{
						Name: aws.String(record),
						Type: aws.String("A"),
						ResourceRecords: []*route53.ResourceRecord{
							{
								Value: aws.String(dest),
							},
						},
						TTL: aws.Int64(60),
					},
				},
			},
			Comment: aws.String("ResourceDescription"),
		},
		HostedZoneId: aws.String(zone),
	})

	return err
}
開發者ID:sthulb,項目名稱:route53-autoreg,代碼行數:27,代碼來源:aws.go

示例7: ExampleRoute53_ListChangeBatchesByRRSet

func ExampleRoute53_ListChangeBatchesByRRSet() {
	svc := route53.New(session.New())

	params := &route53.ListChangeBatchesByRRSetInput{
		EndDate:       aws.String("Date"),       // Required
		HostedZoneId:  aws.String("ResourceId"), // Required
		Name:          aws.String("DNSName"),    // Required
		StartDate:     aws.String("Date"),       // Required
		Type:          aws.String("RRType"),     // Required
		Marker:        aws.String("PageMarker"),
		MaxItems:      aws.String("PageMaxItems"),
		SetIdentifier: aws.String("ResourceRecordSetIdentifier"),
	}
	resp, err := svc.ListChangeBatchesByRRSet(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)
}
開發者ID:ColourboxDevelopment,項目名稱:aws-sdk-go,代碼行數:25,代碼來源:examples_test.go

示例8: ExampleRoute53_CreateReusableDelegationSet

func ExampleRoute53_CreateReusableDelegationSet() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := route53.New(sess)

	params := &route53.CreateReusableDelegationSetInput{
		CallerReference: aws.String("Nonce"), // Required
		HostedZoneId:    aws.String("ResourceId"),
	}
	resp, err := svc.CreateReusableDelegationSet(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)
}
開發者ID:roman-vynar,項目名稱:grafana,代碼行數:25,代碼來源:examples_test.go

示例9: ExampleRoute53_CreateTrafficPolicyInstance

func ExampleRoute53_CreateTrafficPolicyInstance() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := route53.New(sess)

	params := &route53.CreateTrafficPolicyInstanceInput{
		HostedZoneId:         aws.String("ResourceId"),      // Required
		Name:                 aws.String("DNSName"),         // Required
		TTL:                  aws.Int64(1),                  // Required
		TrafficPolicyId:      aws.String("TrafficPolicyId"), // Required
		TrafficPolicyVersion: aws.Int64(1),                  // Required
	}
	resp, err := svc.CreateTrafficPolicyInstance(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)
}
開發者ID:roman-vynar,項目名稱:grafana,代碼行數:28,代碼來源:examples_test.go

示例10: ExampleRoute53_ListTrafficPolicyInstancesByPolicy

func ExampleRoute53_ListTrafficPolicyInstancesByPolicy() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := route53.New(sess)

	params := &route53.ListTrafficPolicyInstancesByPolicyInput{
		TrafficPolicyId:                 aws.String("TrafficPolicyId"), // Required
		TrafficPolicyVersion:            aws.Int64(1),                  // Required
		HostedZoneIdMarker:              aws.String("ResourceId"),
		MaxItems:                        aws.String("PageMaxItems"),
		TrafficPolicyInstanceNameMarker: aws.String("DNSName"),
		TrafficPolicyInstanceTypeMarker: aws.String("RRType"),
	}
	resp, err := svc.ListTrafficPolicyInstancesByPolicy(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)
}
開發者ID:roman-vynar,項目名稱:grafana,代碼行數:29,代碼來源:examples_test.go

示例11: ExampleRoute53_UpdateHostedZoneComment

func ExampleRoute53_UpdateHostedZoneComment() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := route53.New(sess)

	params := &route53.UpdateHostedZoneCommentInput{
		Id:      aws.String("ResourceId"), // Required
		Comment: aws.String("ResourceDescription"),
	}
	resp, err := svc.UpdateHostedZoneComment(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)
}
開發者ID:roman-vynar,項目名稱:grafana,代碼行數:25,代碼來源:examples_test.go

示例12: ExampleRoute53_ListTagsForResources

func ExampleRoute53_ListTagsForResources() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := route53.New(sess)

	params := &route53.ListTagsForResourcesInput{
		ResourceIds: []*string{ // Required
			aws.String("TagResourceId"), // Required
			// More values...
		},
		ResourceType: aws.String("TagResourceType"), // Required
	}
	resp, err := svc.ListTagsForResources(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)
}
開發者ID:roman-vynar,項目名稱:grafana,代碼行數:28,代碼來源:examples_test.go

示例13: ExampleRoute53_ListResourceRecordSets

func ExampleRoute53_ListResourceRecordSets() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := route53.New(sess)

	params := &route53.ListResourceRecordSetsInput{
		HostedZoneId:          aws.String("ResourceId"), // Required
		MaxItems:              aws.String("PageMaxItems"),
		StartRecordIdentifier: aws.String("ResourceRecordSetIdentifier"),
		StartRecordName:       aws.String("DNSName"),
		StartRecordType:       aws.String("RRType"),
	}
	resp, err := svc.ListResourceRecordSets(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)
}
開發者ID:roman-vynar,項目名稱:grafana,代碼行數:28,代碼來源:examples_test.go

示例14: ExampleRoute53_ListHostedZonesByName

func ExampleRoute53_ListHostedZonesByName() {
	svc := route53.New(nil)

	params := &route53.ListHostedZonesByNameInput{
		DNSName:      aws.String("DNSName"),
		HostedZoneID: aws.String("ResourceId"),
		MaxItems:     aws.String("PageMaxItems"),
	}
	resp, err := svc.ListHostedZonesByName(params)

	if err != nil {
		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 {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
開發者ID:Talos208,項目名稱:aws-sdk-go,代碼行數:28,代碼來源:examples_test.go

示例15: ExampleRoute53_ListHostedZonesByName

func ExampleRoute53_ListHostedZonesByName() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := route53.New(sess)

	params := &route53.ListHostedZonesByNameInput{
		DNSName:      aws.String("DNSName"),
		HostedZoneId: aws.String("ResourceId"),
		MaxItems:     aws.String("PageMaxItems"),
	}
	resp, err := svc.ListHostedZonesByName(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)
}
開發者ID:roman-vynar,項目名稱:grafana,代碼行數:26,代碼來源:examples_test.go


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