| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- package applicationdiscoveryservice_test
- import (
- "bytes"
- "fmt"
- "time"
- "github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/aws/session"
- "github.com/aws/aws-sdk-go/service/applicationdiscoveryservice"
- )
- var _ time.Duration
- var _ bytes.Buffer
- func ExampleApplicationDiscoveryService_CreateTags() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := applicationdiscoveryservice.New(sess)
- params := &applicationdiscoveryservice.CreateTagsInput{
- ConfigurationIds: []*string{ // Required
- aws.String("ConfigurationId"), // Required
- // More values...
- },
- Tags: []*applicationdiscoveryservice.Tag{ // Required
- { // Required
- Key: aws.String("TagKey"), // Required
- Value: aws.String("TagValue"), // Required
- },
- // More values...
- },
- }
- resp, err := svc.CreateTags(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)
- }
- func ExampleApplicationDiscoveryService_DeleteTags() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := applicationdiscoveryservice.New(sess)
- params := &applicationdiscoveryservice.DeleteTagsInput{
- ConfigurationIds: []*string{ // Required
- aws.String("ConfigurationId"), // Required
- // More values...
- },
- Tags: []*applicationdiscoveryservice.Tag{
- { // Required
- Key: aws.String("TagKey"), // Required
- Value: aws.String("TagValue"), // Required
- },
- // More values...
- },
- }
- resp, err := svc.DeleteTags(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)
- }
- func ExampleApplicationDiscoveryService_DescribeAgents() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := applicationdiscoveryservice.New(sess)
- params := &applicationdiscoveryservice.DescribeAgentsInput{
- AgentIds: []*string{
- aws.String("AgentId"), // Required
- // More values...
- },
- MaxResults: aws.Int64(1),
- NextToken: aws.String("NextToken"),
- }
- resp, err := svc.DescribeAgents(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)
- }
- func ExampleApplicationDiscoveryService_DescribeConfigurations() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := applicationdiscoveryservice.New(sess)
- params := &applicationdiscoveryservice.DescribeConfigurationsInput{
- ConfigurationIds: []*string{ // Required
- aws.String("ConfigurationId"), // Required
- // More values...
- },
- }
- resp, err := svc.DescribeConfigurations(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)
- }
- func ExampleApplicationDiscoveryService_DescribeExportConfigurations() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := applicationdiscoveryservice.New(sess)
- params := &applicationdiscoveryservice.DescribeExportConfigurationsInput{
- ExportIds: []*string{
- aws.String("ConfigurationsExportId"), // Required
- // More values...
- },
- MaxResults: aws.Int64(1),
- NextToken: aws.String("NextToken"),
- }
- resp, err := svc.DescribeExportConfigurations(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)
- }
- func ExampleApplicationDiscoveryService_DescribeTags() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := applicationdiscoveryservice.New(sess)
- params := &applicationdiscoveryservice.DescribeTagsInput{
- Filters: []*applicationdiscoveryservice.TagFilter{
- { // Required
- Name: aws.String("FilterName"), // Required
- Values: []*string{ // Required
- aws.String("FilterValue"), // Required
- // More values...
- },
- },
- // More values...
- },
- MaxResults: aws.Int64(1),
- NextToken: aws.String("NextToken"),
- }
- resp, err := svc.DescribeTags(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)
- }
- func ExampleApplicationDiscoveryService_ExportConfigurations() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := applicationdiscoveryservice.New(sess)
- var params *applicationdiscoveryservice.ExportConfigurationsInput
- resp, err := svc.ExportConfigurations(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)
- }
- func ExampleApplicationDiscoveryService_ListConfigurations() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := applicationdiscoveryservice.New(sess)
- params := &applicationdiscoveryservice.ListConfigurationsInput{
- ConfigurationType: aws.String("ConfigurationItemType"), // Required
- Filters: []*applicationdiscoveryservice.Filter{
- { // Required
- Condition: aws.String("Condition"), // Required
- Name: aws.String("String"), // Required
- Values: []*string{ // Required
- aws.String("FilterValue"), // Required
- // More values...
- },
- },
- // More values...
- },
- MaxResults: aws.Int64(1),
- NextToken: aws.String("NextToken"),
- }
- resp, err := svc.ListConfigurations(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)
- }
- func ExampleApplicationDiscoveryService_StartDataCollectionByAgentIds() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := applicationdiscoveryservice.New(sess)
- params := &applicationdiscoveryservice.StartDataCollectionByAgentIdsInput{
- AgentIds: []*string{ // Required
- aws.String("AgentId"), // Required
- // More values...
- },
- }
- resp, err := svc.StartDataCollectionByAgentIds(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)
- }
- func ExampleApplicationDiscoveryService_StopDataCollectionByAgentIds() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := applicationdiscoveryservice.New(sess)
- params := &applicationdiscoveryservice.StopDataCollectionByAgentIdsInput{
- AgentIds: []*string{ // Required
- aws.String("AgentId"), // Required
- // More values...
- },
- }
- resp, err := svc.StopDataCollectionByAgentIds(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)
- }
|