examples_test.go 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package efs_test
  3. import (
  4. "bytes"
  5. "fmt"
  6. "time"
  7. "github.com/aws/aws-sdk-go/aws"
  8. "github.com/aws/aws-sdk-go/service/efs"
  9. )
  10. var _ time.Duration
  11. var _ bytes.Buffer
  12. func ExampleEFS_CreateFileSystem() {
  13. svc := efs.New(nil)
  14. params := &efs.CreateFileSystemInput{
  15. CreationToken: aws.String("CreationToken"), // Required
  16. }
  17. resp, err := svc.CreateFileSystem(params)
  18. if err != nil {
  19. // Print the error, cast err to awserr.Error to get the Code and
  20. // Message from an error.
  21. fmt.Println(err.Error())
  22. return
  23. }
  24. // Pretty-print the response data.
  25. fmt.Println(resp)
  26. }
  27. func ExampleEFS_CreateMountTarget() {
  28. svc := efs.New(nil)
  29. params := &efs.CreateMountTargetInput{
  30. FileSystemId: aws.String("FileSystemId"), // Required
  31. SubnetId: aws.String("SubnetId"), // Required
  32. IpAddress: aws.String("IpAddress"),
  33. SecurityGroups: []*string{
  34. aws.String("SecurityGroup"), // Required
  35. // More values...
  36. },
  37. }
  38. resp, err := svc.CreateMountTarget(params)
  39. if err != nil {
  40. // Print the error, cast err to awserr.Error to get the Code and
  41. // Message from an error.
  42. fmt.Println(err.Error())
  43. return
  44. }
  45. // Pretty-print the response data.
  46. fmt.Println(resp)
  47. }
  48. func ExampleEFS_CreateTags() {
  49. svc := efs.New(nil)
  50. params := &efs.CreateTagsInput{
  51. FileSystemId: aws.String("FileSystemId"), // Required
  52. Tags: []*efs.Tag{ // Required
  53. { // Required
  54. Key: aws.String("TagKey"), // Required
  55. Value: aws.String("TagValue"), // Required
  56. },
  57. // More values...
  58. },
  59. }
  60. resp, err := svc.CreateTags(params)
  61. if err != nil {
  62. // Print the error, cast err to awserr.Error to get the Code and
  63. // Message from an error.
  64. fmt.Println(err.Error())
  65. return
  66. }
  67. // Pretty-print the response data.
  68. fmt.Println(resp)
  69. }
  70. func ExampleEFS_DeleteFileSystem() {
  71. svc := efs.New(nil)
  72. params := &efs.DeleteFileSystemInput{
  73. FileSystemId: aws.String("FileSystemId"), // Required
  74. }
  75. resp, err := svc.DeleteFileSystem(params)
  76. if err != nil {
  77. // Print the error, cast err to awserr.Error to get the Code and
  78. // Message from an error.
  79. fmt.Println(err.Error())
  80. return
  81. }
  82. // Pretty-print the response data.
  83. fmt.Println(resp)
  84. }
  85. func ExampleEFS_DeleteMountTarget() {
  86. svc := efs.New(nil)
  87. params := &efs.DeleteMountTargetInput{
  88. MountTargetId: aws.String("MountTargetId"), // Required
  89. }
  90. resp, err := svc.DeleteMountTarget(params)
  91. if err != nil {
  92. // Print the error, cast err to awserr.Error to get the Code and
  93. // Message from an error.
  94. fmt.Println(err.Error())
  95. return
  96. }
  97. // Pretty-print the response data.
  98. fmt.Println(resp)
  99. }
  100. func ExampleEFS_DeleteTags() {
  101. svc := efs.New(nil)
  102. params := &efs.DeleteTagsInput{
  103. FileSystemId: aws.String("FileSystemId"), // Required
  104. TagKeys: []*string{ // Required
  105. aws.String("TagKey"), // Required
  106. // More values...
  107. },
  108. }
  109. resp, err := svc.DeleteTags(params)
  110. if err != nil {
  111. // Print the error, cast err to awserr.Error to get the Code and
  112. // Message from an error.
  113. fmt.Println(err.Error())
  114. return
  115. }
  116. // Pretty-print the response data.
  117. fmt.Println(resp)
  118. }
  119. func ExampleEFS_DescribeFileSystems() {
  120. svc := efs.New(nil)
  121. params := &efs.DescribeFileSystemsInput{
  122. CreationToken: aws.String("CreationToken"),
  123. FileSystemId: aws.String("FileSystemId"),
  124. Marker: aws.String("Marker"),
  125. MaxItems: aws.Int64(1),
  126. }
  127. resp, err := svc.DescribeFileSystems(params)
  128. if err != nil {
  129. // Print the error, cast err to awserr.Error to get the Code and
  130. // Message from an error.
  131. fmt.Println(err.Error())
  132. return
  133. }
  134. // Pretty-print the response data.
  135. fmt.Println(resp)
  136. }
  137. func ExampleEFS_DescribeMountTargetSecurityGroups() {
  138. svc := efs.New(nil)
  139. params := &efs.DescribeMountTargetSecurityGroupsInput{
  140. MountTargetId: aws.String("MountTargetId"), // Required
  141. }
  142. resp, err := svc.DescribeMountTargetSecurityGroups(params)
  143. if err != nil {
  144. // Print the error, cast err to awserr.Error to get the Code and
  145. // Message from an error.
  146. fmt.Println(err.Error())
  147. return
  148. }
  149. // Pretty-print the response data.
  150. fmt.Println(resp)
  151. }
  152. func ExampleEFS_DescribeMountTargets() {
  153. svc := efs.New(nil)
  154. params := &efs.DescribeMountTargetsInput{
  155. FileSystemId: aws.String("FileSystemId"), // Required
  156. Marker: aws.String("Marker"),
  157. MaxItems: aws.Int64(1),
  158. }
  159. resp, err := svc.DescribeMountTargets(params)
  160. if err != nil {
  161. // Print the error, cast err to awserr.Error to get the Code and
  162. // Message from an error.
  163. fmt.Println(err.Error())
  164. return
  165. }
  166. // Pretty-print the response data.
  167. fmt.Println(resp)
  168. }
  169. func ExampleEFS_DescribeTags() {
  170. svc := efs.New(nil)
  171. params := &efs.DescribeTagsInput{
  172. FileSystemId: aws.String("FileSystemId"), // Required
  173. Marker: aws.String("Marker"),
  174. MaxItems: aws.Int64(1),
  175. }
  176. resp, err := svc.DescribeTags(params)
  177. if err != nil {
  178. // Print the error, cast err to awserr.Error to get the Code and
  179. // Message from an error.
  180. fmt.Println(err.Error())
  181. return
  182. }
  183. // Pretty-print the response data.
  184. fmt.Println(resp)
  185. }
  186. func ExampleEFS_ModifyMountTargetSecurityGroups() {
  187. svc := efs.New(nil)
  188. params := &efs.ModifyMountTargetSecurityGroupsInput{
  189. MountTargetId: aws.String("MountTargetId"), // Required
  190. SecurityGroups: []*string{
  191. aws.String("SecurityGroup"), // Required
  192. // More values...
  193. },
  194. }
  195. resp, err := svc.ModifyMountTargetSecurityGroups(params)
  196. if err != nil {
  197. // Print the error, cast err to awserr.Error to get the Code and
  198. // Message from an error.
  199. fmt.Println(err.Error())
  200. return
  201. }
  202. // Pretty-print the response data.
  203. fmt.Println(resp)
  204. }