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


Golang elasticbeanstalk.New函數代碼示例

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


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

示例1: ExampleElasticBeanstalk_DescribeEvents

func ExampleElasticBeanstalk_DescribeEvents() {
	svc := elasticbeanstalk.New(session.New())

	params := &elasticbeanstalk.DescribeEventsInput{
		ApplicationName: aws.String("ApplicationName"),
		EndTime:         aws.Time(time.Now()),
		EnvironmentId:   aws.String("EnvironmentId"),
		EnvironmentName: aws.String("EnvironmentName"),
		MaxRecords:      aws.Int64(1),
		NextToken:       aws.String("Token"),
		RequestId:       aws.String("RequestId"),
		Severity:        aws.String("EventSeverity"),
		StartTime:       aws.Time(time.Now()),
		TemplateName:    aws.String("ConfigurationTemplateName"),
		VersionLabel:    aws.String("VersionLabel"),
	}
	resp, err := svc.DescribeEvents(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:bluet-deps,項目名稱:aws-sdk-go,代碼行數:28,代碼來源:examples_test.go

示例2: ExampleElasticBeanstalk_CreateApplicationVersion

func ExampleElasticBeanstalk_CreateApplicationVersion() {
	svc := elasticbeanstalk.New(session.New())

	params := &elasticbeanstalk.CreateApplicationVersionInput{
		ApplicationName:       aws.String("ApplicationName"), // Required
		VersionLabel:          aws.String("VersionLabel"),    // Required
		AutoCreateApplication: aws.Bool(true),
		Description:           aws.String("Description"),
		Process:               aws.Bool(true),
		SourceBundle: &elasticbeanstalk.S3Location{
			S3Bucket: aws.String("S3Bucket"),
			S3Key:    aws.String("S3Key"),
		},
	}
	resp, err := svc.CreateApplicationVersion(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:bluet-deps,項目名稱:aws-sdk-go,代碼行數:26,代碼來源:examples_test.go

示例3: ExampleElasticBeanstalk_DescribeEnvironments

func ExampleElasticBeanstalk_DescribeEnvironments() {
	svc := elasticbeanstalk.New(session.New())

	params := &elasticbeanstalk.DescribeEnvironmentsInput{
		ApplicationName: aws.String("ApplicationName"),
		EnvironmentIds: []*string{
			aws.String("EnvironmentId"), // Required
			// More values...
		},
		EnvironmentNames: []*string{
			aws.String("EnvironmentName"), // Required
			// More values...
		},
		IncludeDeleted:        aws.Bool(true),
		IncludedDeletedBackTo: aws.Time(time.Now()),
		VersionLabel:          aws.String("VersionLabel"),
	}
	resp, err := svc.DescribeEnvironments(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:bluet-deps,項目名稱:aws-sdk-go,代碼行數:29,代碼來源:examples_test.go

示例4: ExampleElasticBeanstalk_ValidateConfigurationSettings

func ExampleElasticBeanstalk_ValidateConfigurationSettings() {
	svc := elasticbeanstalk.New(session.New())

	params := &elasticbeanstalk.ValidateConfigurationSettingsInput{
		ApplicationName: aws.String("ApplicationName"), // Required
		OptionSettings: []*elasticbeanstalk.ConfigurationOptionSetting{ // Required
			{ // Required
				Namespace:    aws.String("OptionNamespace"),
				OptionName:   aws.String("ConfigurationOptionName"),
				ResourceName: aws.String("ResourceName"),
				Value:        aws.String("ConfigurationOptionValue"),
			},
			// More values...
		},
		EnvironmentName: aws.String("EnvironmentName"),
		TemplateName:    aws.String("ConfigurationTemplateName"),
	}
	resp, err := svc.ValidateConfigurationSettings(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:bluet-deps,項目名稱:aws-sdk-go,代碼行數:29,代碼來源:examples_test.go

示例5: ExampleElasticBeanstalk_CreateEnvironment

func ExampleElasticBeanstalk_CreateEnvironment() {
	svc := elasticbeanstalk.New(session.New())

	params := &elasticbeanstalk.CreateEnvironmentInput{
		ApplicationName: aws.String("ApplicationName"), // Required
		CNAMEPrefix:     aws.String("DNSCnamePrefix"),
		Description:     aws.String("Description"),
		EnvironmentName: aws.String("EnvironmentName"),
		GroupName:       aws.String("GroupName"),
		OptionSettings: []*elasticbeanstalk.ConfigurationOptionSetting{
			{ // Required
				Namespace:    aws.String("OptionNamespace"),
				OptionName:   aws.String("ConfigurationOptionName"),
				ResourceName: aws.String("ResourceName"),
				Value:        aws.String("ConfigurationOptionValue"),
			},
			// More values...
		},
		OptionsToRemove: []*elasticbeanstalk.OptionSpecification{
			{ // Required
				Namespace:    aws.String("OptionNamespace"),
				OptionName:   aws.String("ConfigurationOptionName"),
				ResourceName: aws.String("ResourceName"),
			},
			// More values...
		},
		SolutionStackName: aws.String("SolutionStackName"),
		Tags: []*elasticbeanstalk.Tag{
			{ // Required
				Key:   aws.String("TagKey"),
				Value: aws.String("TagValue"),
			},
			// More values...
		},
		TemplateName: aws.String("ConfigurationTemplateName"),
		Tier: &elasticbeanstalk.EnvironmentTier{
			Name:    aws.String("String"),
			Type:    aws.String("String"),
			Version: aws.String("String"),
		},
		VersionLabel: aws.String("VersionLabel"),
	}
	resp, err := svc.CreateEnvironment(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:bluet-deps,項目名稱:aws-sdk-go,代碼行數:54,代碼來源:examples_test.go

示例6: ExampleElasticBeanstalk_ListAvailableSolutionStacks

func ExampleElasticBeanstalk_ListAvailableSolutionStacks() {
	svc := elasticbeanstalk.New(session.New())

	var params *elasticbeanstalk.ListAvailableSolutionStacksInput
	resp, err := svc.ListAvailableSolutionStacks(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:bluet-deps,項目名稱:aws-sdk-go,代碼行數:16,代碼來源:examples_test.go

示例7: ExampleElasticBeanstalk_CreateStorageLocation

func ExampleElasticBeanstalk_CreateStorageLocation() {
	svc := elasticbeanstalk.New(session.New())

	var params *elasticbeanstalk.CreateStorageLocationInput
	resp, err := svc.CreateStorageLocation(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:bluet-deps,項目名稱:aws-sdk-go,代碼行數:16,代碼來源:examples_test.go

示例8: ExampleElasticBeanstalk_CheckDNSAvailability

func ExampleElasticBeanstalk_CheckDNSAvailability() {
	svc := elasticbeanstalk.New(session.New())

	params := &elasticbeanstalk.CheckDNSAvailabilityInput{
		CNAMEPrefix: aws.String("DNSCnamePrefix"), // Required
	}
	resp, err := svc.CheckDNSAvailability(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:bluet-deps,項目名稱:aws-sdk-go,代碼行數:18,代碼來源:examples_test.go

示例9: ExampleElasticBeanstalk_DeleteEnvironmentConfiguration

func ExampleElasticBeanstalk_DeleteEnvironmentConfiguration() {
	svc := elasticbeanstalk.New(session.New())

	params := &elasticbeanstalk.DeleteEnvironmentConfigurationInput{
		ApplicationName: aws.String("ApplicationName"), // Required
		EnvironmentName: aws.String("EnvironmentName"), // Required
	}
	resp, err := svc.DeleteEnvironmentConfiguration(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:bluet-deps,項目名稱:aws-sdk-go,代碼行數:19,代碼來源:examples_test.go

示例10: ExampleElasticBeanstalk_CreateApplication

func ExampleElasticBeanstalk_CreateApplication() {
	svc := elasticbeanstalk.New(session.New())

	params := &elasticbeanstalk.CreateApplicationInput{
		ApplicationName: aws.String("ApplicationName"), // Required
		Description:     aws.String("Description"),
	}
	resp, err := svc.CreateApplication(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:bluet-deps,項目名稱:aws-sdk-go,代碼行數:19,代碼來源:examples_test.go

示例11: ExampleElasticBeanstalk_RestartAppServer

func ExampleElasticBeanstalk_RestartAppServer() {
	svc := elasticbeanstalk.New(session.New())

	params := &elasticbeanstalk.RestartAppServerInput{
		EnvironmentId:   aws.String("EnvironmentId"),
		EnvironmentName: aws.String("EnvironmentName"),
	}
	resp, err := svc.RestartAppServer(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:bluet-deps,項目名稱:aws-sdk-go,代碼行數:19,代碼來源:examples_test.go

示例12: ExampleElasticBeanstalk_DeleteApplicationVersion

func ExampleElasticBeanstalk_DeleteApplicationVersion() {
	svc := elasticbeanstalk.New(session.New())

	params := &elasticbeanstalk.DeleteApplicationVersionInput{
		ApplicationName:    aws.String("ApplicationName"), // Required
		VersionLabel:       aws.String("VersionLabel"),    // Required
		DeleteSourceBundle: aws.Bool(true),
	}
	resp, err := svc.DeleteApplicationVersion(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:bluet-deps,項目名稱:aws-sdk-go,代碼行數:20,代碼來源:examples_test.go

示例13: ExampleElasticBeanstalk_TerminateEnvironment

func ExampleElasticBeanstalk_TerminateEnvironment() {
	svc := elasticbeanstalk.New(session.New())

	params := &elasticbeanstalk.TerminateEnvironmentInput{
		EnvironmentId:      aws.String("EnvironmentId"),
		EnvironmentName:    aws.String("EnvironmentName"),
		ForceTerminate:     aws.Bool(true),
		TerminateResources: aws.Bool(true),
	}
	resp, err := svc.TerminateEnvironment(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:bluet-deps,項目名稱:aws-sdk-go,代碼行數:21,代碼來源:examples_test.go

示例14: ExampleElasticBeanstalk_SwapEnvironmentCNAMEs

func ExampleElasticBeanstalk_SwapEnvironmentCNAMEs() {
	svc := elasticbeanstalk.New(session.New())

	params := &elasticbeanstalk.SwapEnvironmentCNAMEsInput{
		DestinationEnvironmentId:   aws.String("EnvironmentId"),
		DestinationEnvironmentName: aws.String("EnvironmentName"),
		SourceEnvironmentId:        aws.String("EnvironmentId"),
		SourceEnvironmentName:      aws.String("EnvironmentName"),
	}
	resp, err := svc.SwapEnvironmentCNAMEs(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:bluet-deps,項目名稱:aws-sdk-go,代碼行數:21,代碼來源:examples_test.go

示例15: ExampleElasticBeanstalk_DescribeApplications

func ExampleElasticBeanstalk_DescribeApplications() {
	svc := elasticbeanstalk.New(session.New())

	params := &elasticbeanstalk.DescribeApplicationsInput{
		ApplicationNames: []*string{
			aws.String("ApplicationName"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeApplications(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:bluet-deps,項目名稱:aws-sdk-go,代碼行數:21,代碼來源:examples_test.go


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