examples_test.go 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package opsworks_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/opsworks"
  9. )
  10. var _ time.Duration
  11. var _ bytes.Buffer
  12. func ExampleOpsWorks_AssignInstance() {
  13. svc := opsworks.New(nil)
  14. params := &opsworks.AssignInstanceInput{
  15. InstanceId: aws.String("String"), // Required
  16. LayerIds: []*string{ // Required
  17. aws.String("String"), // Required
  18. // More values...
  19. },
  20. }
  21. resp, err := svc.AssignInstance(params)
  22. if err != nil {
  23. // Print the error, cast err to awserr.Error to get the Code and
  24. // Message from an error.
  25. fmt.Println(err.Error())
  26. return
  27. }
  28. // Pretty-print the response data.
  29. fmt.Println(resp)
  30. }
  31. func ExampleOpsWorks_AssignVolume() {
  32. svc := opsworks.New(nil)
  33. params := &opsworks.AssignVolumeInput{
  34. VolumeId: aws.String("String"), // Required
  35. InstanceId: aws.String("String"),
  36. }
  37. resp, err := svc.AssignVolume(params)
  38. if err != nil {
  39. // Print the error, cast err to awserr.Error to get the Code and
  40. // Message from an error.
  41. fmt.Println(err.Error())
  42. return
  43. }
  44. // Pretty-print the response data.
  45. fmt.Println(resp)
  46. }
  47. func ExampleOpsWorks_AssociateElasticIp() {
  48. svc := opsworks.New(nil)
  49. params := &opsworks.AssociateElasticIpInput{
  50. ElasticIp: aws.String("String"), // Required
  51. InstanceId: aws.String("String"),
  52. }
  53. resp, err := svc.AssociateElasticIp(params)
  54. if err != nil {
  55. // Print the error, cast err to awserr.Error to get the Code and
  56. // Message from an error.
  57. fmt.Println(err.Error())
  58. return
  59. }
  60. // Pretty-print the response data.
  61. fmt.Println(resp)
  62. }
  63. func ExampleOpsWorks_AttachElasticLoadBalancer() {
  64. svc := opsworks.New(nil)
  65. params := &opsworks.AttachElasticLoadBalancerInput{
  66. ElasticLoadBalancerName: aws.String("String"), // Required
  67. LayerId: aws.String("String"), // Required
  68. }
  69. resp, err := svc.AttachElasticLoadBalancer(params)
  70. if err != nil {
  71. // Print the error, cast err to awserr.Error to get the Code and
  72. // Message from an error.
  73. fmt.Println(err.Error())
  74. return
  75. }
  76. // Pretty-print the response data.
  77. fmt.Println(resp)
  78. }
  79. func ExampleOpsWorks_CloneStack() {
  80. svc := opsworks.New(nil)
  81. params := &opsworks.CloneStackInput{
  82. ServiceRoleArn: aws.String("String"), // Required
  83. SourceStackId: aws.String("String"), // Required
  84. AgentVersion: aws.String("String"),
  85. Attributes: map[string]*string{
  86. "Key": aws.String("String"), // Required
  87. // More values...
  88. },
  89. ChefConfiguration: &opsworks.ChefConfiguration{
  90. BerkshelfVersion: aws.String("String"),
  91. ManageBerkshelf: aws.Bool(true),
  92. },
  93. CloneAppIds: []*string{
  94. aws.String("String"), // Required
  95. // More values...
  96. },
  97. ClonePermissions: aws.Bool(true),
  98. ConfigurationManager: &opsworks.StackConfigurationManager{
  99. Name: aws.String("String"),
  100. Version: aws.String("String"),
  101. },
  102. CustomCookbooksSource: &opsworks.Source{
  103. Password: aws.String("String"),
  104. Revision: aws.String("String"),
  105. SshKey: aws.String("String"),
  106. Type: aws.String("SourceType"),
  107. Url: aws.String("String"),
  108. Username: aws.String("String"),
  109. },
  110. CustomJson: aws.String("String"),
  111. DefaultAvailabilityZone: aws.String("String"),
  112. DefaultInstanceProfileArn: aws.String("String"),
  113. DefaultOs: aws.String("String"),
  114. DefaultRootDeviceType: aws.String("RootDeviceType"),
  115. DefaultSshKeyName: aws.String("String"),
  116. DefaultSubnetId: aws.String("String"),
  117. HostnameTheme: aws.String("String"),
  118. Name: aws.String("String"),
  119. Region: aws.String("String"),
  120. UseCustomCookbooks: aws.Bool(true),
  121. UseOpsworksSecurityGroups: aws.Bool(true),
  122. VpcId: aws.String("String"),
  123. }
  124. resp, err := svc.CloneStack(params)
  125. if err != nil {
  126. // Print the error, cast err to awserr.Error to get the Code and
  127. // Message from an error.
  128. fmt.Println(err.Error())
  129. return
  130. }
  131. // Pretty-print the response data.
  132. fmt.Println(resp)
  133. }
  134. func ExampleOpsWorks_CreateApp() {
  135. svc := opsworks.New(nil)
  136. params := &opsworks.CreateAppInput{
  137. Name: aws.String("String"), // Required
  138. StackId: aws.String("String"), // Required
  139. Type: aws.String("AppType"), // Required
  140. AppSource: &opsworks.Source{
  141. Password: aws.String("String"),
  142. Revision: aws.String("String"),
  143. SshKey: aws.String("String"),
  144. Type: aws.String("SourceType"),
  145. Url: aws.String("String"),
  146. Username: aws.String("String"),
  147. },
  148. Attributes: map[string]*string{
  149. "Key": aws.String("String"), // Required
  150. // More values...
  151. },
  152. DataSources: []*opsworks.DataSource{
  153. { // Required
  154. Arn: aws.String("String"),
  155. DatabaseName: aws.String("String"),
  156. Type: aws.String("String"),
  157. },
  158. // More values...
  159. },
  160. Description: aws.String("String"),
  161. Domains: []*string{
  162. aws.String("String"), // Required
  163. // More values...
  164. },
  165. EnableSsl: aws.Bool(true),
  166. Environment: []*opsworks.EnvironmentVariable{
  167. { // Required
  168. Key: aws.String("String"), // Required
  169. Value: aws.String("String"), // Required
  170. Secure: aws.Bool(true),
  171. },
  172. // More values...
  173. },
  174. Shortname: aws.String("String"),
  175. SslConfiguration: &opsworks.SslConfiguration{
  176. Certificate: aws.String("String"), // Required
  177. PrivateKey: aws.String("String"), // Required
  178. Chain: aws.String("String"),
  179. },
  180. }
  181. resp, err := svc.CreateApp(params)
  182. if err != nil {
  183. // Print the error, cast err to awserr.Error to get the Code and
  184. // Message from an error.
  185. fmt.Println(err.Error())
  186. return
  187. }
  188. // Pretty-print the response data.
  189. fmt.Println(resp)
  190. }
  191. func ExampleOpsWorks_CreateDeployment() {
  192. svc := opsworks.New(nil)
  193. params := &opsworks.CreateDeploymentInput{
  194. Command: &opsworks.DeploymentCommand{ // Required
  195. Name: aws.String("DeploymentCommandName"), // Required
  196. Args: map[string][]*string{
  197. "Key": { // Required
  198. aws.String("String"), // Required
  199. // More values...
  200. },
  201. // More values...
  202. },
  203. },
  204. StackId: aws.String("String"), // Required
  205. AppId: aws.String("String"),
  206. Comment: aws.String("String"),
  207. CustomJson: aws.String("String"),
  208. InstanceIds: []*string{
  209. aws.String("String"), // Required
  210. // More values...
  211. },
  212. }
  213. resp, err := svc.CreateDeployment(params)
  214. if err != nil {
  215. // Print the error, cast err to awserr.Error to get the Code and
  216. // Message from an error.
  217. fmt.Println(err.Error())
  218. return
  219. }
  220. // Pretty-print the response data.
  221. fmt.Println(resp)
  222. }
  223. func ExampleOpsWorks_CreateInstance() {
  224. svc := opsworks.New(nil)
  225. params := &opsworks.CreateInstanceInput{
  226. InstanceType: aws.String("String"), // Required
  227. LayerIds: []*string{ // Required
  228. aws.String("String"), // Required
  229. // More values...
  230. },
  231. StackId: aws.String("String"), // Required
  232. AgentVersion: aws.String("String"),
  233. AmiId: aws.String("String"),
  234. Architecture: aws.String("Architecture"),
  235. AutoScalingType: aws.String("AutoScalingType"),
  236. AvailabilityZone: aws.String("String"),
  237. BlockDeviceMappings: []*opsworks.BlockDeviceMapping{
  238. { // Required
  239. DeviceName: aws.String("String"),
  240. Ebs: &opsworks.EbsBlockDevice{
  241. DeleteOnTermination: aws.Bool(true),
  242. Iops: aws.Int64(1),
  243. SnapshotId: aws.String("String"),
  244. VolumeSize: aws.Int64(1),
  245. VolumeType: aws.String("VolumeType"),
  246. },
  247. NoDevice: aws.String("String"),
  248. VirtualName: aws.String("String"),
  249. },
  250. // More values...
  251. },
  252. EbsOptimized: aws.Bool(true),
  253. Hostname: aws.String("String"),
  254. InstallUpdatesOnBoot: aws.Bool(true),
  255. Os: aws.String("String"),
  256. RootDeviceType: aws.String("RootDeviceType"),
  257. SshKeyName: aws.String("String"),
  258. SubnetId: aws.String("String"),
  259. VirtualizationType: aws.String("String"),
  260. }
  261. resp, err := svc.CreateInstance(params)
  262. if err != nil {
  263. // Print the error, cast err to awserr.Error to get the Code and
  264. // Message from an error.
  265. fmt.Println(err.Error())
  266. return
  267. }
  268. // Pretty-print the response data.
  269. fmt.Println(resp)
  270. }
  271. func ExampleOpsWorks_CreateLayer() {
  272. svc := opsworks.New(nil)
  273. params := &opsworks.CreateLayerInput{
  274. Name: aws.String("String"), // Required
  275. Shortname: aws.String("String"), // Required
  276. StackId: aws.String("String"), // Required
  277. Type: aws.String("LayerType"), // Required
  278. Attributes: map[string]*string{
  279. "Key": aws.String("String"), // Required
  280. // More values...
  281. },
  282. AutoAssignElasticIps: aws.Bool(true),
  283. AutoAssignPublicIps: aws.Bool(true),
  284. CustomInstanceProfileArn: aws.String("String"),
  285. CustomJson: aws.String("String"),
  286. CustomRecipes: &opsworks.Recipes{
  287. Configure: []*string{
  288. aws.String("String"), // Required
  289. // More values...
  290. },
  291. Deploy: []*string{
  292. aws.String("String"), // Required
  293. // More values...
  294. },
  295. Setup: []*string{
  296. aws.String("String"), // Required
  297. // More values...
  298. },
  299. Shutdown: []*string{
  300. aws.String("String"), // Required
  301. // More values...
  302. },
  303. Undeploy: []*string{
  304. aws.String("String"), // Required
  305. // More values...
  306. },
  307. },
  308. CustomSecurityGroupIds: []*string{
  309. aws.String("String"), // Required
  310. // More values...
  311. },
  312. EnableAutoHealing: aws.Bool(true),
  313. InstallUpdatesOnBoot: aws.Bool(true),
  314. LifecycleEventConfiguration: &opsworks.LifecycleEventConfiguration{
  315. Shutdown: &opsworks.ShutdownEventConfiguration{
  316. DelayUntilElbConnectionsDrained: aws.Bool(true),
  317. ExecutionTimeout: aws.Int64(1),
  318. },
  319. },
  320. Packages: []*string{
  321. aws.String("String"), // Required
  322. // More values...
  323. },
  324. UseEbsOptimizedInstances: aws.Bool(true),
  325. VolumeConfigurations: []*opsworks.VolumeConfiguration{
  326. { // Required
  327. MountPoint: aws.String("String"), // Required
  328. NumberOfDisks: aws.Int64(1), // Required
  329. Size: aws.Int64(1), // Required
  330. Iops: aws.Int64(1),
  331. RaidLevel: aws.Int64(1),
  332. VolumeType: aws.String("String"),
  333. },
  334. // More values...
  335. },
  336. }
  337. resp, err := svc.CreateLayer(params)
  338. if err != nil {
  339. // Print the error, cast err to awserr.Error to get the Code and
  340. // Message from an error.
  341. fmt.Println(err.Error())
  342. return
  343. }
  344. // Pretty-print the response data.
  345. fmt.Println(resp)
  346. }
  347. func ExampleOpsWorks_CreateStack() {
  348. svc := opsworks.New(nil)
  349. params := &opsworks.CreateStackInput{
  350. DefaultInstanceProfileArn: aws.String("String"), // Required
  351. Name: aws.String("String"), // Required
  352. Region: aws.String("String"), // Required
  353. ServiceRoleArn: aws.String("String"), // Required
  354. AgentVersion: aws.String("String"),
  355. Attributes: map[string]*string{
  356. "Key": aws.String("String"), // Required
  357. // More values...
  358. },
  359. ChefConfiguration: &opsworks.ChefConfiguration{
  360. BerkshelfVersion: aws.String("String"),
  361. ManageBerkshelf: aws.Bool(true),
  362. },
  363. ConfigurationManager: &opsworks.StackConfigurationManager{
  364. Name: aws.String("String"),
  365. Version: aws.String("String"),
  366. },
  367. CustomCookbooksSource: &opsworks.Source{
  368. Password: aws.String("String"),
  369. Revision: aws.String("String"),
  370. SshKey: aws.String("String"),
  371. Type: aws.String("SourceType"),
  372. Url: aws.String("String"),
  373. Username: aws.String("String"),
  374. },
  375. CustomJson: aws.String("String"),
  376. DefaultAvailabilityZone: aws.String("String"),
  377. DefaultOs: aws.String("String"),
  378. DefaultRootDeviceType: aws.String("RootDeviceType"),
  379. DefaultSshKeyName: aws.String("String"),
  380. DefaultSubnetId: aws.String("String"),
  381. HostnameTheme: aws.String("String"),
  382. UseCustomCookbooks: aws.Bool(true),
  383. UseOpsworksSecurityGroups: aws.Bool(true),
  384. VpcId: aws.String("String"),
  385. }
  386. resp, err := svc.CreateStack(params)
  387. if err != nil {
  388. // Print the error, cast err to awserr.Error to get the Code and
  389. // Message from an error.
  390. fmt.Println(err.Error())
  391. return
  392. }
  393. // Pretty-print the response data.
  394. fmt.Println(resp)
  395. }
  396. func ExampleOpsWorks_CreateUserProfile() {
  397. svc := opsworks.New(nil)
  398. params := &opsworks.CreateUserProfileInput{
  399. IamUserArn: aws.String("String"), // Required
  400. AllowSelfManagement: aws.Bool(true),
  401. SshPublicKey: aws.String("String"),
  402. SshUsername: aws.String("String"),
  403. }
  404. resp, err := svc.CreateUserProfile(params)
  405. if err != nil {
  406. // Print the error, cast err to awserr.Error to get the Code and
  407. // Message from an error.
  408. fmt.Println(err.Error())
  409. return
  410. }
  411. // Pretty-print the response data.
  412. fmt.Println(resp)
  413. }
  414. func ExampleOpsWorks_DeleteApp() {
  415. svc := opsworks.New(nil)
  416. params := &opsworks.DeleteAppInput{
  417. AppId: aws.String("String"), // Required
  418. }
  419. resp, err := svc.DeleteApp(params)
  420. if err != nil {
  421. // Print the error, cast err to awserr.Error to get the Code and
  422. // Message from an error.
  423. fmt.Println(err.Error())
  424. return
  425. }
  426. // Pretty-print the response data.
  427. fmt.Println(resp)
  428. }
  429. func ExampleOpsWorks_DeleteInstance() {
  430. svc := opsworks.New(nil)
  431. params := &opsworks.DeleteInstanceInput{
  432. InstanceId: aws.String("String"), // Required
  433. DeleteElasticIp: aws.Bool(true),
  434. DeleteVolumes: aws.Bool(true),
  435. }
  436. resp, err := svc.DeleteInstance(params)
  437. if err != nil {
  438. // Print the error, cast err to awserr.Error to get the Code and
  439. // Message from an error.
  440. fmt.Println(err.Error())
  441. return
  442. }
  443. // Pretty-print the response data.
  444. fmt.Println(resp)
  445. }
  446. func ExampleOpsWorks_DeleteLayer() {
  447. svc := opsworks.New(nil)
  448. params := &opsworks.DeleteLayerInput{
  449. LayerId: aws.String("String"), // Required
  450. }
  451. resp, err := svc.DeleteLayer(params)
  452. if err != nil {
  453. // Print the error, cast err to awserr.Error to get the Code and
  454. // Message from an error.
  455. fmt.Println(err.Error())
  456. return
  457. }
  458. // Pretty-print the response data.
  459. fmt.Println(resp)
  460. }
  461. func ExampleOpsWorks_DeleteStack() {
  462. svc := opsworks.New(nil)
  463. params := &opsworks.DeleteStackInput{
  464. StackId: aws.String("String"), // Required
  465. }
  466. resp, err := svc.DeleteStack(params)
  467. if err != nil {
  468. // Print the error, cast err to awserr.Error to get the Code and
  469. // Message from an error.
  470. fmt.Println(err.Error())
  471. return
  472. }
  473. // Pretty-print the response data.
  474. fmt.Println(resp)
  475. }
  476. func ExampleOpsWorks_DeleteUserProfile() {
  477. svc := opsworks.New(nil)
  478. params := &opsworks.DeleteUserProfileInput{
  479. IamUserArn: aws.String("String"), // Required
  480. }
  481. resp, err := svc.DeleteUserProfile(params)
  482. if err != nil {
  483. // Print the error, cast err to awserr.Error to get the Code and
  484. // Message from an error.
  485. fmt.Println(err.Error())
  486. return
  487. }
  488. // Pretty-print the response data.
  489. fmt.Println(resp)
  490. }
  491. func ExampleOpsWorks_DeregisterEcsCluster() {
  492. svc := opsworks.New(nil)
  493. params := &opsworks.DeregisterEcsClusterInput{
  494. EcsClusterArn: aws.String("String"), // Required
  495. }
  496. resp, err := svc.DeregisterEcsCluster(params)
  497. if err != nil {
  498. // Print the error, cast err to awserr.Error to get the Code and
  499. // Message from an error.
  500. fmt.Println(err.Error())
  501. return
  502. }
  503. // Pretty-print the response data.
  504. fmt.Println(resp)
  505. }
  506. func ExampleOpsWorks_DeregisterElasticIp() {
  507. svc := opsworks.New(nil)
  508. params := &opsworks.DeregisterElasticIpInput{
  509. ElasticIp: aws.String("String"), // Required
  510. }
  511. resp, err := svc.DeregisterElasticIp(params)
  512. if err != nil {
  513. // Print the error, cast err to awserr.Error to get the Code and
  514. // Message from an error.
  515. fmt.Println(err.Error())
  516. return
  517. }
  518. // Pretty-print the response data.
  519. fmt.Println(resp)
  520. }
  521. func ExampleOpsWorks_DeregisterInstance() {
  522. svc := opsworks.New(nil)
  523. params := &opsworks.DeregisterInstanceInput{
  524. InstanceId: aws.String("String"), // Required
  525. }
  526. resp, err := svc.DeregisterInstance(params)
  527. if err != nil {
  528. // Print the error, cast err to awserr.Error to get the Code and
  529. // Message from an error.
  530. fmt.Println(err.Error())
  531. return
  532. }
  533. // Pretty-print the response data.
  534. fmt.Println(resp)
  535. }
  536. func ExampleOpsWorks_DeregisterRdsDbInstance() {
  537. svc := opsworks.New(nil)
  538. params := &opsworks.DeregisterRdsDbInstanceInput{
  539. RdsDbInstanceArn: aws.String("String"), // Required
  540. }
  541. resp, err := svc.DeregisterRdsDbInstance(params)
  542. if err != nil {
  543. // Print the error, cast err to awserr.Error to get the Code and
  544. // Message from an error.
  545. fmt.Println(err.Error())
  546. return
  547. }
  548. // Pretty-print the response data.
  549. fmt.Println(resp)
  550. }
  551. func ExampleOpsWorks_DeregisterVolume() {
  552. svc := opsworks.New(nil)
  553. params := &opsworks.DeregisterVolumeInput{
  554. VolumeId: aws.String("String"), // Required
  555. }
  556. resp, err := svc.DeregisterVolume(params)
  557. if err != nil {
  558. // Print the error, cast err to awserr.Error to get the Code and
  559. // Message from an error.
  560. fmt.Println(err.Error())
  561. return
  562. }
  563. // Pretty-print the response data.
  564. fmt.Println(resp)
  565. }
  566. func ExampleOpsWorks_DescribeAgentVersions() {
  567. svc := opsworks.New(nil)
  568. params := &opsworks.DescribeAgentVersionsInput{
  569. ConfigurationManager: &opsworks.StackConfigurationManager{
  570. Name: aws.String("String"),
  571. Version: aws.String("String"),
  572. },
  573. StackId: aws.String("String"),
  574. }
  575. resp, err := svc.DescribeAgentVersions(params)
  576. if err != nil {
  577. // Print the error, cast err to awserr.Error to get the Code and
  578. // Message from an error.
  579. fmt.Println(err.Error())
  580. return
  581. }
  582. // Pretty-print the response data.
  583. fmt.Println(resp)
  584. }
  585. func ExampleOpsWorks_DescribeApps() {
  586. svc := opsworks.New(nil)
  587. params := &opsworks.DescribeAppsInput{
  588. AppIds: []*string{
  589. aws.String("String"), // Required
  590. // More values...
  591. },
  592. StackId: aws.String("String"),
  593. }
  594. resp, err := svc.DescribeApps(params)
  595. if err != nil {
  596. // Print the error, cast err to awserr.Error to get the Code and
  597. // Message from an error.
  598. fmt.Println(err.Error())
  599. return
  600. }
  601. // Pretty-print the response data.
  602. fmt.Println(resp)
  603. }
  604. func ExampleOpsWorks_DescribeCommands() {
  605. svc := opsworks.New(nil)
  606. params := &opsworks.DescribeCommandsInput{
  607. CommandIds: []*string{
  608. aws.String("String"), // Required
  609. // More values...
  610. },
  611. DeploymentId: aws.String("String"),
  612. InstanceId: aws.String("String"),
  613. }
  614. resp, err := svc.DescribeCommands(params)
  615. if err != nil {
  616. // Print the error, cast err to awserr.Error to get the Code and
  617. // Message from an error.
  618. fmt.Println(err.Error())
  619. return
  620. }
  621. // Pretty-print the response data.
  622. fmt.Println(resp)
  623. }
  624. func ExampleOpsWorks_DescribeDeployments() {
  625. svc := opsworks.New(nil)
  626. params := &opsworks.DescribeDeploymentsInput{
  627. AppId: aws.String("String"),
  628. DeploymentIds: []*string{
  629. aws.String("String"), // Required
  630. // More values...
  631. },
  632. StackId: aws.String("String"),
  633. }
  634. resp, err := svc.DescribeDeployments(params)
  635. if err != nil {
  636. // Print the error, cast err to awserr.Error to get the Code and
  637. // Message from an error.
  638. fmt.Println(err.Error())
  639. return
  640. }
  641. // Pretty-print the response data.
  642. fmt.Println(resp)
  643. }
  644. func ExampleOpsWorks_DescribeEcsClusters() {
  645. svc := opsworks.New(nil)
  646. params := &opsworks.DescribeEcsClustersInput{
  647. EcsClusterArns: []*string{
  648. aws.String("String"), // Required
  649. // More values...
  650. },
  651. MaxResults: aws.Int64(1),
  652. NextToken: aws.String("String"),
  653. StackId: aws.String("String"),
  654. }
  655. resp, err := svc.DescribeEcsClusters(params)
  656. if err != nil {
  657. // Print the error, cast err to awserr.Error to get the Code and
  658. // Message from an error.
  659. fmt.Println(err.Error())
  660. return
  661. }
  662. // Pretty-print the response data.
  663. fmt.Println(resp)
  664. }
  665. func ExampleOpsWorks_DescribeElasticIps() {
  666. svc := opsworks.New(nil)
  667. params := &opsworks.DescribeElasticIpsInput{
  668. InstanceId: aws.String("String"),
  669. Ips: []*string{
  670. aws.String("String"), // Required
  671. // More values...
  672. },
  673. StackId: aws.String("String"),
  674. }
  675. resp, err := svc.DescribeElasticIps(params)
  676. if err != nil {
  677. // Print the error, cast err to awserr.Error to get the Code and
  678. // Message from an error.
  679. fmt.Println(err.Error())
  680. return
  681. }
  682. // Pretty-print the response data.
  683. fmt.Println(resp)
  684. }
  685. func ExampleOpsWorks_DescribeElasticLoadBalancers() {
  686. svc := opsworks.New(nil)
  687. params := &opsworks.DescribeElasticLoadBalancersInput{
  688. LayerIds: []*string{
  689. aws.String("String"), // Required
  690. // More values...
  691. },
  692. StackId: aws.String("String"),
  693. }
  694. resp, err := svc.DescribeElasticLoadBalancers(params)
  695. if err != nil {
  696. // Print the error, cast err to awserr.Error to get the Code and
  697. // Message from an error.
  698. fmt.Println(err.Error())
  699. return
  700. }
  701. // Pretty-print the response data.
  702. fmt.Println(resp)
  703. }
  704. func ExampleOpsWorks_DescribeInstances() {
  705. svc := opsworks.New(nil)
  706. params := &opsworks.DescribeInstancesInput{
  707. InstanceIds: []*string{
  708. aws.String("String"), // Required
  709. // More values...
  710. },
  711. LayerId: aws.String("String"),
  712. StackId: aws.String("String"),
  713. }
  714. resp, err := svc.DescribeInstances(params)
  715. if err != nil {
  716. // Print the error, cast err to awserr.Error to get the Code and
  717. // Message from an error.
  718. fmt.Println(err.Error())
  719. return
  720. }
  721. // Pretty-print the response data.
  722. fmt.Println(resp)
  723. }
  724. func ExampleOpsWorks_DescribeLayers() {
  725. svc := opsworks.New(nil)
  726. params := &opsworks.DescribeLayersInput{
  727. LayerIds: []*string{
  728. aws.String("String"), // Required
  729. // More values...
  730. },
  731. StackId: aws.String("String"),
  732. }
  733. resp, err := svc.DescribeLayers(params)
  734. if err != nil {
  735. // Print the error, cast err to awserr.Error to get the Code and
  736. // Message from an error.
  737. fmt.Println(err.Error())
  738. return
  739. }
  740. // Pretty-print the response data.
  741. fmt.Println(resp)
  742. }
  743. func ExampleOpsWorks_DescribeLoadBasedAutoScaling() {
  744. svc := opsworks.New(nil)
  745. params := &opsworks.DescribeLoadBasedAutoScalingInput{
  746. LayerIds: []*string{ // Required
  747. aws.String("String"), // Required
  748. // More values...
  749. },
  750. }
  751. resp, err := svc.DescribeLoadBasedAutoScaling(params)
  752. if err != nil {
  753. // Print the error, cast err to awserr.Error to get the Code and
  754. // Message from an error.
  755. fmt.Println(err.Error())
  756. return
  757. }
  758. // Pretty-print the response data.
  759. fmt.Println(resp)
  760. }
  761. func ExampleOpsWorks_DescribeMyUserProfile() {
  762. svc := opsworks.New(nil)
  763. var params *opsworks.DescribeMyUserProfileInput
  764. resp, err := svc.DescribeMyUserProfile(params)
  765. if err != nil {
  766. // Print the error, cast err to awserr.Error to get the Code and
  767. // Message from an error.
  768. fmt.Println(err.Error())
  769. return
  770. }
  771. // Pretty-print the response data.
  772. fmt.Println(resp)
  773. }
  774. func ExampleOpsWorks_DescribePermissions() {
  775. svc := opsworks.New(nil)
  776. params := &opsworks.DescribePermissionsInput{
  777. IamUserArn: aws.String("String"),
  778. StackId: aws.String("String"),
  779. }
  780. resp, err := svc.DescribePermissions(params)
  781. if err != nil {
  782. // Print the error, cast err to awserr.Error to get the Code and
  783. // Message from an error.
  784. fmt.Println(err.Error())
  785. return
  786. }
  787. // Pretty-print the response data.
  788. fmt.Println(resp)
  789. }
  790. func ExampleOpsWorks_DescribeRaidArrays() {
  791. svc := opsworks.New(nil)
  792. params := &opsworks.DescribeRaidArraysInput{
  793. InstanceId: aws.String("String"),
  794. RaidArrayIds: []*string{
  795. aws.String("String"), // Required
  796. // More values...
  797. },
  798. StackId: aws.String("String"),
  799. }
  800. resp, err := svc.DescribeRaidArrays(params)
  801. if err != nil {
  802. // Print the error, cast err to awserr.Error to get the Code and
  803. // Message from an error.
  804. fmt.Println(err.Error())
  805. return
  806. }
  807. // Pretty-print the response data.
  808. fmt.Println(resp)
  809. }
  810. func ExampleOpsWorks_DescribeRdsDbInstances() {
  811. svc := opsworks.New(nil)
  812. params := &opsworks.DescribeRdsDbInstancesInput{
  813. StackId: aws.String("String"), // Required
  814. RdsDbInstanceArns: []*string{
  815. aws.String("String"), // Required
  816. // More values...
  817. },
  818. }
  819. resp, err := svc.DescribeRdsDbInstances(params)
  820. if err != nil {
  821. // Print the error, cast err to awserr.Error to get the Code and
  822. // Message from an error.
  823. fmt.Println(err.Error())
  824. return
  825. }
  826. // Pretty-print the response data.
  827. fmt.Println(resp)
  828. }
  829. func ExampleOpsWorks_DescribeServiceErrors() {
  830. svc := opsworks.New(nil)
  831. params := &opsworks.DescribeServiceErrorsInput{
  832. InstanceId: aws.String("String"),
  833. ServiceErrorIds: []*string{
  834. aws.String("String"), // Required
  835. // More values...
  836. },
  837. StackId: aws.String("String"),
  838. }
  839. resp, err := svc.DescribeServiceErrors(params)
  840. if err != nil {
  841. // Print the error, cast err to awserr.Error to get the Code and
  842. // Message from an error.
  843. fmt.Println(err.Error())
  844. return
  845. }
  846. // Pretty-print the response data.
  847. fmt.Println(resp)
  848. }
  849. func ExampleOpsWorks_DescribeStackProvisioningParameters() {
  850. svc := opsworks.New(nil)
  851. params := &opsworks.DescribeStackProvisioningParametersInput{
  852. StackId: aws.String("String"), // Required
  853. }
  854. resp, err := svc.DescribeStackProvisioningParameters(params)
  855. if err != nil {
  856. // Print the error, cast err to awserr.Error to get the Code and
  857. // Message from an error.
  858. fmt.Println(err.Error())
  859. return
  860. }
  861. // Pretty-print the response data.
  862. fmt.Println(resp)
  863. }
  864. func ExampleOpsWorks_DescribeStackSummary() {
  865. svc := opsworks.New(nil)
  866. params := &opsworks.DescribeStackSummaryInput{
  867. StackId: aws.String("String"), // Required
  868. }
  869. resp, err := svc.DescribeStackSummary(params)
  870. if err != nil {
  871. // Print the error, cast err to awserr.Error to get the Code and
  872. // Message from an error.
  873. fmt.Println(err.Error())
  874. return
  875. }
  876. // Pretty-print the response data.
  877. fmt.Println(resp)
  878. }
  879. func ExampleOpsWorks_DescribeStacks() {
  880. svc := opsworks.New(nil)
  881. params := &opsworks.DescribeStacksInput{
  882. StackIds: []*string{
  883. aws.String("String"), // Required
  884. // More values...
  885. },
  886. }
  887. resp, err := svc.DescribeStacks(params)
  888. if err != nil {
  889. // Print the error, cast err to awserr.Error to get the Code and
  890. // Message from an error.
  891. fmt.Println(err.Error())
  892. return
  893. }
  894. // Pretty-print the response data.
  895. fmt.Println(resp)
  896. }
  897. func ExampleOpsWorks_DescribeTimeBasedAutoScaling() {
  898. svc := opsworks.New(nil)
  899. params := &opsworks.DescribeTimeBasedAutoScalingInput{
  900. InstanceIds: []*string{ // Required
  901. aws.String("String"), // Required
  902. // More values...
  903. },
  904. }
  905. resp, err := svc.DescribeTimeBasedAutoScaling(params)
  906. if err != nil {
  907. // Print the error, cast err to awserr.Error to get the Code and
  908. // Message from an error.
  909. fmt.Println(err.Error())
  910. return
  911. }
  912. // Pretty-print the response data.
  913. fmt.Println(resp)
  914. }
  915. func ExampleOpsWorks_DescribeUserProfiles() {
  916. svc := opsworks.New(nil)
  917. params := &opsworks.DescribeUserProfilesInput{
  918. IamUserArns: []*string{
  919. aws.String("String"), // Required
  920. // More values...
  921. },
  922. }
  923. resp, err := svc.DescribeUserProfiles(params)
  924. if err != nil {
  925. // Print the error, cast err to awserr.Error to get the Code and
  926. // Message from an error.
  927. fmt.Println(err.Error())
  928. return
  929. }
  930. // Pretty-print the response data.
  931. fmt.Println(resp)
  932. }
  933. func ExampleOpsWorks_DescribeVolumes() {
  934. svc := opsworks.New(nil)
  935. params := &opsworks.DescribeVolumesInput{
  936. InstanceId: aws.String("String"),
  937. RaidArrayId: aws.String("String"),
  938. StackId: aws.String("String"),
  939. VolumeIds: []*string{
  940. aws.String("String"), // Required
  941. // More values...
  942. },
  943. }
  944. resp, err := svc.DescribeVolumes(params)
  945. if err != nil {
  946. // Print the error, cast err to awserr.Error to get the Code and
  947. // Message from an error.
  948. fmt.Println(err.Error())
  949. return
  950. }
  951. // Pretty-print the response data.
  952. fmt.Println(resp)
  953. }
  954. func ExampleOpsWorks_DetachElasticLoadBalancer() {
  955. svc := opsworks.New(nil)
  956. params := &opsworks.DetachElasticLoadBalancerInput{
  957. ElasticLoadBalancerName: aws.String("String"), // Required
  958. LayerId: aws.String("String"), // Required
  959. }
  960. resp, err := svc.DetachElasticLoadBalancer(params)
  961. if err != nil {
  962. // Print the error, cast err to awserr.Error to get the Code and
  963. // Message from an error.
  964. fmt.Println(err.Error())
  965. return
  966. }
  967. // Pretty-print the response data.
  968. fmt.Println(resp)
  969. }
  970. func ExampleOpsWorks_DisassociateElasticIp() {
  971. svc := opsworks.New(nil)
  972. params := &opsworks.DisassociateElasticIpInput{
  973. ElasticIp: aws.String("String"), // Required
  974. }
  975. resp, err := svc.DisassociateElasticIp(params)
  976. if err != nil {
  977. // Print the error, cast err to awserr.Error to get the Code and
  978. // Message from an error.
  979. fmt.Println(err.Error())
  980. return
  981. }
  982. // Pretty-print the response data.
  983. fmt.Println(resp)
  984. }
  985. func ExampleOpsWorks_GetHostnameSuggestion() {
  986. svc := opsworks.New(nil)
  987. params := &opsworks.GetHostnameSuggestionInput{
  988. LayerId: aws.String("String"), // Required
  989. }
  990. resp, err := svc.GetHostnameSuggestion(params)
  991. if err != nil {
  992. // Print the error, cast err to awserr.Error to get the Code and
  993. // Message from an error.
  994. fmt.Println(err.Error())
  995. return
  996. }
  997. // Pretty-print the response data.
  998. fmt.Println(resp)
  999. }
  1000. func ExampleOpsWorks_GrantAccess() {
  1001. svc := opsworks.New(nil)
  1002. params := &opsworks.GrantAccessInput{
  1003. InstanceId: aws.String("String"), // Required
  1004. ValidForInMinutes: aws.Int64(1),
  1005. }
  1006. resp, err := svc.GrantAccess(params)
  1007. if err != nil {
  1008. // Print the error, cast err to awserr.Error to get the Code and
  1009. // Message from an error.
  1010. fmt.Println(err.Error())
  1011. return
  1012. }
  1013. // Pretty-print the response data.
  1014. fmt.Println(resp)
  1015. }
  1016. func ExampleOpsWorks_RebootInstance() {
  1017. svc := opsworks.New(nil)
  1018. params := &opsworks.RebootInstanceInput{
  1019. InstanceId: aws.String("String"), // Required
  1020. }
  1021. resp, err := svc.RebootInstance(params)
  1022. if err != nil {
  1023. // Print the error, cast err to awserr.Error to get the Code and
  1024. // Message from an error.
  1025. fmt.Println(err.Error())
  1026. return
  1027. }
  1028. // Pretty-print the response data.
  1029. fmt.Println(resp)
  1030. }
  1031. func ExampleOpsWorks_RegisterEcsCluster() {
  1032. svc := opsworks.New(nil)
  1033. params := &opsworks.RegisterEcsClusterInput{
  1034. EcsClusterArn: aws.String("String"), // Required
  1035. StackId: aws.String("String"), // Required
  1036. }
  1037. resp, err := svc.RegisterEcsCluster(params)
  1038. if err != nil {
  1039. // Print the error, cast err to awserr.Error to get the Code and
  1040. // Message from an error.
  1041. fmt.Println(err.Error())
  1042. return
  1043. }
  1044. // Pretty-print the response data.
  1045. fmt.Println(resp)
  1046. }
  1047. func ExampleOpsWorks_RegisterElasticIp() {
  1048. svc := opsworks.New(nil)
  1049. params := &opsworks.RegisterElasticIpInput{
  1050. ElasticIp: aws.String("String"), // Required
  1051. StackId: aws.String("String"), // Required
  1052. }
  1053. resp, err := svc.RegisterElasticIp(params)
  1054. if err != nil {
  1055. // Print the error, cast err to awserr.Error to get the Code and
  1056. // Message from an error.
  1057. fmt.Println(err.Error())
  1058. return
  1059. }
  1060. // Pretty-print the response data.
  1061. fmt.Println(resp)
  1062. }
  1063. func ExampleOpsWorks_RegisterInstance() {
  1064. svc := opsworks.New(nil)
  1065. params := &opsworks.RegisterInstanceInput{
  1066. StackId: aws.String("String"), // Required
  1067. Hostname: aws.String("String"),
  1068. InstanceIdentity: &opsworks.InstanceIdentity{
  1069. Document: aws.String("String"),
  1070. Signature: aws.String("String"),
  1071. },
  1072. PrivateIp: aws.String("String"),
  1073. PublicIp: aws.String("String"),
  1074. RsaPublicKey: aws.String("String"),
  1075. RsaPublicKeyFingerprint: aws.String("String"),
  1076. }
  1077. resp, err := svc.RegisterInstance(params)
  1078. if err != nil {
  1079. // Print the error, cast err to awserr.Error to get the Code and
  1080. // Message from an error.
  1081. fmt.Println(err.Error())
  1082. return
  1083. }
  1084. // Pretty-print the response data.
  1085. fmt.Println(resp)
  1086. }
  1087. func ExampleOpsWorks_RegisterRdsDbInstance() {
  1088. svc := opsworks.New(nil)
  1089. params := &opsworks.RegisterRdsDbInstanceInput{
  1090. DbPassword: aws.String("String"), // Required
  1091. DbUser: aws.String("String"), // Required
  1092. RdsDbInstanceArn: aws.String("String"), // Required
  1093. StackId: aws.String("String"), // Required
  1094. }
  1095. resp, err := svc.RegisterRdsDbInstance(params)
  1096. if err != nil {
  1097. // Print the error, cast err to awserr.Error to get the Code and
  1098. // Message from an error.
  1099. fmt.Println(err.Error())
  1100. return
  1101. }
  1102. // Pretty-print the response data.
  1103. fmt.Println(resp)
  1104. }
  1105. func ExampleOpsWorks_RegisterVolume() {
  1106. svc := opsworks.New(nil)
  1107. params := &opsworks.RegisterVolumeInput{
  1108. StackId: aws.String("String"), // Required
  1109. Ec2VolumeId: aws.String("String"),
  1110. }
  1111. resp, err := svc.RegisterVolume(params)
  1112. if err != nil {
  1113. // Print the error, cast err to awserr.Error to get the Code and
  1114. // Message from an error.
  1115. fmt.Println(err.Error())
  1116. return
  1117. }
  1118. // Pretty-print the response data.
  1119. fmt.Println(resp)
  1120. }
  1121. func ExampleOpsWorks_SetLoadBasedAutoScaling() {
  1122. svc := opsworks.New(nil)
  1123. params := &opsworks.SetLoadBasedAutoScalingInput{
  1124. LayerId: aws.String("String"), // Required
  1125. DownScaling: &opsworks.AutoScalingThresholds{
  1126. Alarms: []*string{
  1127. aws.String("String"), // Required
  1128. // More values...
  1129. },
  1130. CpuThreshold: aws.Float64(1.0),
  1131. IgnoreMetricsTime: aws.Int64(1),
  1132. InstanceCount: aws.Int64(1),
  1133. LoadThreshold: aws.Float64(1.0),
  1134. MemoryThreshold: aws.Float64(1.0),
  1135. ThresholdsWaitTime: aws.Int64(1),
  1136. },
  1137. Enable: aws.Bool(true),
  1138. UpScaling: &opsworks.AutoScalingThresholds{
  1139. Alarms: []*string{
  1140. aws.String("String"), // Required
  1141. // More values...
  1142. },
  1143. CpuThreshold: aws.Float64(1.0),
  1144. IgnoreMetricsTime: aws.Int64(1),
  1145. InstanceCount: aws.Int64(1),
  1146. LoadThreshold: aws.Float64(1.0),
  1147. MemoryThreshold: aws.Float64(1.0),
  1148. ThresholdsWaitTime: aws.Int64(1),
  1149. },
  1150. }
  1151. resp, err := svc.SetLoadBasedAutoScaling(params)
  1152. if err != nil {
  1153. // Print the error, cast err to awserr.Error to get the Code and
  1154. // Message from an error.
  1155. fmt.Println(err.Error())
  1156. return
  1157. }
  1158. // Pretty-print the response data.
  1159. fmt.Println(resp)
  1160. }
  1161. func ExampleOpsWorks_SetPermission() {
  1162. svc := opsworks.New(nil)
  1163. params := &opsworks.SetPermissionInput{
  1164. IamUserArn: aws.String("String"), // Required
  1165. StackId: aws.String("String"), // Required
  1166. AllowSsh: aws.Bool(true),
  1167. AllowSudo: aws.Bool(true),
  1168. Level: aws.String("String"),
  1169. }
  1170. resp, err := svc.SetPermission(params)
  1171. if err != nil {
  1172. // Print the error, cast err to awserr.Error to get the Code and
  1173. // Message from an error.
  1174. fmt.Println(err.Error())
  1175. return
  1176. }
  1177. // Pretty-print the response data.
  1178. fmt.Println(resp)
  1179. }
  1180. func ExampleOpsWorks_SetTimeBasedAutoScaling() {
  1181. svc := opsworks.New(nil)
  1182. params := &opsworks.SetTimeBasedAutoScalingInput{
  1183. InstanceId: aws.String("String"), // Required
  1184. AutoScalingSchedule: &opsworks.WeeklyAutoScalingSchedule{
  1185. Friday: map[string]*string{
  1186. "Key": aws.String("Switch"), // Required
  1187. // More values...
  1188. },
  1189. Monday: map[string]*string{
  1190. "Key": aws.String("Switch"), // Required
  1191. // More values...
  1192. },
  1193. Saturday: map[string]*string{
  1194. "Key": aws.String("Switch"), // Required
  1195. // More values...
  1196. },
  1197. Sunday: map[string]*string{
  1198. "Key": aws.String("Switch"), // Required
  1199. // More values...
  1200. },
  1201. Thursday: map[string]*string{
  1202. "Key": aws.String("Switch"), // Required
  1203. // More values...
  1204. },
  1205. Tuesday: map[string]*string{
  1206. "Key": aws.String("Switch"), // Required
  1207. // More values...
  1208. },
  1209. Wednesday: map[string]*string{
  1210. "Key": aws.String("Switch"), // Required
  1211. // More values...
  1212. },
  1213. },
  1214. }
  1215. resp, err := svc.SetTimeBasedAutoScaling(params)
  1216. if err != nil {
  1217. // Print the error, cast err to awserr.Error to get the Code and
  1218. // Message from an error.
  1219. fmt.Println(err.Error())
  1220. return
  1221. }
  1222. // Pretty-print the response data.
  1223. fmt.Println(resp)
  1224. }
  1225. func ExampleOpsWorks_StartInstance() {
  1226. svc := opsworks.New(nil)
  1227. params := &opsworks.StartInstanceInput{
  1228. InstanceId: aws.String("String"), // Required
  1229. }
  1230. resp, err := svc.StartInstance(params)
  1231. if err != nil {
  1232. // Print the error, cast err to awserr.Error to get the Code and
  1233. // Message from an error.
  1234. fmt.Println(err.Error())
  1235. return
  1236. }
  1237. // Pretty-print the response data.
  1238. fmt.Println(resp)
  1239. }
  1240. func ExampleOpsWorks_StartStack() {
  1241. svc := opsworks.New(nil)
  1242. params := &opsworks.StartStackInput{
  1243. StackId: aws.String("String"), // Required
  1244. }
  1245. resp, err := svc.StartStack(params)
  1246. if err != nil {
  1247. // Print the error, cast err to awserr.Error to get the Code and
  1248. // Message from an error.
  1249. fmt.Println(err.Error())
  1250. return
  1251. }
  1252. // Pretty-print the response data.
  1253. fmt.Println(resp)
  1254. }
  1255. func ExampleOpsWorks_StopInstance() {
  1256. svc := opsworks.New(nil)
  1257. params := &opsworks.StopInstanceInput{
  1258. InstanceId: aws.String("String"), // Required
  1259. }
  1260. resp, err := svc.StopInstance(params)
  1261. if err != nil {
  1262. // Print the error, cast err to awserr.Error to get the Code and
  1263. // Message from an error.
  1264. fmt.Println(err.Error())
  1265. return
  1266. }
  1267. // Pretty-print the response data.
  1268. fmt.Println(resp)
  1269. }
  1270. func ExampleOpsWorks_StopStack() {
  1271. svc := opsworks.New(nil)
  1272. params := &opsworks.StopStackInput{
  1273. StackId: aws.String("String"), // Required
  1274. }
  1275. resp, err := svc.StopStack(params)
  1276. if err != nil {
  1277. // Print the error, cast err to awserr.Error to get the Code and
  1278. // Message from an error.
  1279. fmt.Println(err.Error())
  1280. return
  1281. }
  1282. // Pretty-print the response data.
  1283. fmt.Println(resp)
  1284. }
  1285. func ExampleOpsWorks_UnassignInstance() {
  1286. svc := opsworks.New(nil)
  1287. params := &opsworks.UnassignInstanceInput{
  1288. InstanceId: aws.String("String"), // Required
  1289. }
  1290. resp, err := svc.UnassignInstance(params)
  1291. if err != nil {
  1292. // Print the error, cast err to awserr.Error to get the Code and
  1293. // Message from an error.
  1294. fmt.Println(err.Error())
  1295. return
  1296. }
  1297. // Pretty-print the response data.
  1298. fmt.Println(resp)
  1299. }
  1300. func ExampleOpsWorks_UnassignVolume() {
  1301. svc := opsworks.New(nil)
  1302. params := &opsworks.UnassignVolumeInput{
  1303. VolumeId: aws.String("String"), // Required
  1304. }
  1305. resp, err := svc.UnassignVolume(params)
  1306. if err != nil {
  1307. // Print the error, cast err to awserr.Error to get the Code and
  1308. // Message from an error.
  1309. fmt.Println(err.Error())
  1310. return
  1311. }
  1312. // Pretty-print the response data.
  1313. fmt.Println(resp)
  1314. }
  1315. func ExampleOpsWorks_UpdateApp() {
  1316. svc := opsworks.New(nil)
  1317. params := &opsworks.UpdateAppInput{
  1318. AppId: aws.String("String"), // Required
  1319. AppSource: &opsworks.Source{
  1320. Password: aws.String("String"),
  1321. Revision: aws.String("String"),
  1322. SshKey: aws.String("String"),
  1323. Type: aws.String("SourceType"),
  1324. Url: aws.String("String"),
  1325. Username: aws.String("String"),
  1326. },
  1327. Attributes: map[string]*string{
  1328. "Key": aws.String("String"), // Required
  1329. // More values...
  1330. },
  1331. DataSources: []*opsworks.DataSource{
  1332. { // Required
  1333. Arn: aws.String("String"),
  1334. DatabaseName: aws.String("String"),
  1335. Type: aws.String("String"),
  1336. },
  1337. // More values...
  1338. },
  1339. Description: aws.String("String"),
  1340. Domains: []*string{
  1341. aws.String("String"), // Required
  1342. // More values...
  1343. },
  1344. EnableSsl: aws.Bool(true),
  1345. Environment: []*opsworks.EnvironmentVariable{
  1346. { // Required
  1347. Key: aws.String("String"), // Required
  1348. Value: aws.String("String"), // Required
  1349. Secure: aws.Bool(true),
  1350. },
  1351. // More values...
  1352. },
  1353. Name: aws.String("String"),
  1354. SslConfiguration: &opsworks.SslConfiguration{
  1355. Certificate: aws.String("String"), // Required
  1356. PrivateKey: aws.String("String"), // Required
  1357. Chain: aws.String("String"),
  1358. },
  1359. Type: aws.String("AppType"),
  1360. }
  1361. resp, err := svc.UpdateApp(params)
  1362. if err != nil {
  1363. // Print the error, cast err to awserr.Error to get the Code and
  1364. // Message from an error.
  1365. fmt.Println(err.Error())
  1366. return
  1367. }
  1368. // Pretty-print the response data.
  1369. fmt.Println(resp)
  1370. }
  1371. func ExampleOpsWorks_UpdateElasticIp() {
  1372. svc := opsworks.New(nil)
  1373. params := &opsworks.UpdateElasticIpInput{
  1374. ElasticIp: aws.String("String"), // Required
  1375. Name: aws.String("String"),
  1376. }
  1377. resp, err := svc.UpdateElasticIp(params)
  1378. if err != nil {
  1379. // Print the error, cast err to awserr.Error to get the Code and
  1380. // Message from an error.
  1381. fmt.Println(err.Error())
  1382. return
  1383. }
  1384. // Pretty-print the response data.
  1385. fmt.Println(resp)
  1386. }
  1387. func ExampleOpsWorks_UpdateInstance() {
  1388. svc := opsworks.New(nil)
  1389. params := &opsworks.UpdateInstanceInput{
  1390. InstanceId: aws.String("String"), // Required
  1391. AgentVersion: aws.String("String"),
  1392. AmiId: aws.String("String"),
  1393. Architecture: aws.String("Architecture"),
  1394. AutoScalingType: aws.String("AutoScalingType"),
  1395. EbsOptimized: aws.Bool(true),
  1396. Hostname: aws.String("String"),
  1397. InstallUpdatesOnBoot: aws.Bool(true),
  1398. InstanceType: aws.String("String"),
  1399. LayerIds: []*string{
  1400. aws.String("String"), // Required
  1401. // More values...
  1402. },
  1403. Os: aws.String("String"),
  1404. SshKeyName: aws.String("String"),
  1405. }
  1406. resp, err := svc.UpdateInstance(params)
  1407. if err != nil {
  1408. // Print the error, cast err to awserr.Error to get the Code and
  1409. // Message from an error.
  1410. fmt.Println(err.Error())
  1411. return
  1412. }
  1413. // Pretty-print the response data.
  1414. fmt.Println(resp)
  1415. }
  1416. func ExampleOpsWorks_UpdateLayer() {
  1417. svc := opsworks.New(nil)
  1418. params := &opsworks.UpdateLayerInput{
  1419. LayerId: aws.String("String"), // Required
  1420. Attributes: map[string]*string{
  1421. "Key": aws.String("String"), // Required
  1422. // More values...
  1423. },
  1424. AutoAssignElasticIps: aws.Bool(true),
  1425. AutoAssignPublicIps: aws.Bool(true),
  1426. CustomInstanceProfileArn: aws.String("String"),
  1427. CustomJson: aws.String("String"),
  1428. CustomRecipes: &opsworks.Recipes{
  1429. Configure: []*string{
  1430. aws.String("String"), // Required
  1431. // More values...
  1432. },
  1433. Deploy: []*string{
  1434. aws.String("String"), // Required
  1435. // More values...
  1436. },
  1437. Setup: []*string{
  1438. aws.String("String"), // Required
  1439. // More values...
  1440. },
  1441. Shutdown: []*string{
  1442. aws.String("String"), // Required
  1443. // More values...
  1444. },
  1445. Undeploy: []*string{
  1446. aws.String("String"), // Required
  1447. // More values...
  1448. },
  1449. },
  1450. CustomSecurityGroupIds: []*string{
  1451. aws.String("String"), // Required
  1452. // More values...
  1453. },
  1454. EnableAutoHealing: aws.Bool(true),
  1455. InstallUpdatesOnBoot: aws.Bool(true),
  1456. LifecycleEventConfiguration: &opsworks.LifecycleEventConfiguration{
  1457. Shutdown: &opsworks.ShutdownEventConfiguration{
  1458. DelayUntilElbConnectionsDrained: aws.Bool(true),
  1459. ExecutionTimeout: aws.Int64(1),
  1460. },
  1461. },
  1462. Name: aws.String("String"),
  1463. Packages: []*string{
  1464. aws.String("String"), // Required
  1465. // More values...
  1466. },
  1467. Shortname: aws.String("String"),
  1468. UseEbsOptimizedInstances: aws.Bool(true),
  1469. VolumeConfigurations: []*opsworks.VolumeConfiguration{
  1470. { // Required
  1471. MountPoint: aws.String("String"), // Required
  1472. NumberOfDisks: aws.Int64(1), // Required
  1473. Size: aws.Int64(1), // Required
  1474. Iops: aws.Int64(1),
  1475. RaidLevel: aws.Int64(1),
  1476. VolumeType: aws.String("String"),
  1477. },
  1478. // More values...
  1479. },
  1480. }
  1481. resp, err := svc.UpdateLayer(params)
  1482. if err != nil {
  1483. // Print the error, cast err to awserr.Error to get the Code and
  1484. // Message from an error.
  1485. fmt.Println(err.Error())
  1486. return
  1487. }
  1488. // Pretty-print the response data.
  1489. fmt.Println(resp)
  1490. }
  1491. func ExampleOpsWorks_UpdateMyUserProfile() {
  1492. svc := opsworks.New(nil)
  1493. params := &opsworks.UpdateMyUserProfileInput{
  1494. SshPublicKey: aws.String("String"),
  1495. }
  1496. resp, err := svc.UpdateMyUserProfile(params)
  1497. if err != nil {
  1498. // Print the error, cast err to awserr.Error to get the Code and
  1499. // Message from an error.
  1500. fmt.Println(err.Error())
  1501. return
  1502. }
  1503. // Pretty-print the response data.
  1504. fmt.Println(resp)
  1505. }
  1506. func ExampleOpsWorks_UpdateRdsDbInstance() {
  1507. svc := opsworks.New(nil)
  1508. params := &opsworks.UpdateRdsDbInstanceInput{
  1509. RdsDbInstanceArn: aws.String("String"), // Required
  1510. DbPassword: aws.String("String"),
  1511. DbUser: aws.String("String"),
  1512. }
  1513. resp, err := svc.UpdateRdsDbInstance(params)
  1514. if err != nil {
  1515. // Print the error, cast err to awserr.Error to get the Code and
  1516. // Message from an error.
  1517. fmt.Println(err.Error())
  1518. return
  1519. }
  1520. // Pretty-print the response data.
  1521. fmt.Println(resp)
  1522. }
  1523. func ExampleOpsWorks_UpdateStack() {
  1524. svc := opsworks.New(nil)
  1525. params := &opsworks.UpdateStackInput{
  1526. StackId: aws.String("String"), // Required
  1527. AgentVersion: aws.String("String"),
  1528. Attributes: map[string]*string{
  1529. "Key": aws.String("String"), // Required
  1530. // More values...
  1531. },
  1532. ChefConfiguration: &opsworks.ChefConfiguration{
  1533. BerkshelfVersion: aws.String("String"),
  1534. ManageBerkshelf: aws.Bool(true),
  1535. },
  1536. ConfigurationManager: &opsworks.StackConfigurationManager{
  1537. Name: aws.String("String"),
  1538. Version: aws.String("String"),
  1539. },
  1540. CustomCookbooksSource: &opsworks.Source{
  1541. Password: aws.String("String"),
  1542. Revision: aws.String("String"),
  1543. SshKey: aws.String("String"),
  1544. Type: aws.String("SourceType"),
  1545. Url: aws.String("String"),
  1546. Username: aws.String("String"),
  1547. },
  1548. CustomJson: aws.String("String"),
  1549. DefaultAvailabilityZone: aws.String("String"),
  1550. DefaultInstanceProfileArn: aws.String("String"),
  1551. DefaultOs: aws.String("String"),
  1552. DefaultRootDeviceType: aws.String("RootDeviceType"),
  1553. DefaultSshKeyName: aws.String("String"),
  1554. DefaultSubnetId: aws.String("String"),
  1555. HostnameTheme: aws.String("String"),
  1556. Name: aws.String("String"),
  1557. ServiceRoleArn: aws.String("String"),
  1558. UseCustomCookbooks: aws.Bool(true),
  1559. UseOpsworksSecurityGroups: aws.Bool(true),
  1560. }
  1561. resp, err := svc.UpdateStack(params)
  1562. if err != nil {
  1563. // Print the error, cast err to awserr.Error to get the Code and
  1564. // Message from an error.
  1565. fmt.Println(err.Error())
  1566. return
  1567. }
  1568. // Pretty-print the response data.
  1569. fmt.Println(resp)
  1570. }
  1571. func ExampleOpsWorks_UpdateUserProfile() {
  1572. svc := opsworks.New(nil)
  1573. params := &opsworks.UpdateUserProfileInput{
  1574. IamUserArn: aws.String("String"), // Required
  1575. AllowSelfManagement: aws.Bool(true),
  1576. SshPublicKey: aws.String("String"),
  1577. SshUsername: aws.String("String"),
  1578. }
  1579. resp, err := svc.UpdateUserProfile(params)
  1580. if err != nil {
  1581. // Print the error, cast err to awserr.Error to get the Code and
  1582. // Message from an error.
  1583. fmt.Println(err.Error())
  1584. return
  1585. }
  1586. // Pretty-print the response data.
  1587. fmt.Println(resp)
  1588. }
  1589. func ExampleOpsWorks_UpdateVolume() {
  1590. svc := opsworks.New(nil)
  1591. params := &opsworks.UpdateVolumeInput{
  1592. VolumeId: aws.String("String"), // Required
  1593. MountPoint: aws.String("String"),
  1594. Name: aws.String("String"),
  1595. }
  1596. resp, err := svc.UpdateVolume(params)
  1597. if err != nil {
  1598. // Print the error, cast err to awserr.Error to get the Code and
  1599. // Message from an error.
  1600. fmt.Println(err.Error())
  1601. return
  1602. }
  1603. // Pretty-print the response data.
  1604. fmt.Println(resp)
  1605. }