123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362 |
- // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- package cloudhsm_test
- import (
- "bytes"
- "fmt"
- "time"
- "github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/service/cloudhsm"
- )
- var _ time.Duration
- var _ bytes.Buffer
- func ExampleCloudHSM_CreateHapg() {
- svc := cloudhsm.New(nil)
- params := &cloudhsm.CreateHapgInput{
- Label: aws.String("Label"), // Required
- }
- resp, err := svc.CreateHapg(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 ExampleCloudHSM_CreateHsm() {
- svc := cloudhsm.New(nil)
- params := &cloudhsm.CreateHsmInput{
- IamRoleArn: aws.String("IamRoleArn"), // Required
- SshKey: aws.String("SshKey"), // Required
- SubnetId: aws.String("SubnetId"), // Required
- SubscriptionType: aws.String("SubscriptionType"), // Required
- ClientToken: aws.String("ClientToken"),
- EniIp: aws.String("IpAddress"),
- ExternalId: aws.String("ExternalId"),
- SyslogIp: aws.String("IpAddress"),
- }
- resp, err := svc.CreateHsm(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 ExampleCloudHSM_CreateLunaClient() {
- svc := cloudhsm.New(nil)
- params := &cloudhsm.CreateLunaClientInput{
- Certificate: aws.String("Certificate"), // Required
- Label: aws.String("ClientLabel"),
- }
- resp, err := svc.CreateLunaClient(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 ExampleCloudHSM_DeleteHapg() {
- svc := cloudhsm.New(nil)
- params := &cloudhsm.DeleteHapgInput{
- HapgArn: aws.String("HapgArn"), // Required
- }
- resp, err := svc.DeleteHapg(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 ExampleCloudHSM_DeleteHsm() {
- svc := cloudhsm.New(nil)
- params := &cloudhsm.DeleteHsmInput{
- HsmArn: aws.String("HsmArn"), // Required
- }
- resp, err := svc.DeleteHsm(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 ExampleCloudHSM_DeleteLunaClient() {
- svc := cloudhsm.New(nil)
- params := &cloudhsm.DeleteLunaClientInput{
- ClientArn: aws.String("ClientArn"), // Required
- }
- resp, err := svc.DeleteLunaClient(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 ExampleCloudHSM_DescribeHapg() {
- svc := cloudhsm.New(nil)
- params := &cloudhsm.DescribeHapgInput{
- HapgArn: aws.String("HapgArn"), // Required
- }
- resp, err := svc.DescribeHapg(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 ExampleCloudHSM_DescribeHsm() {
- svc := cloudhsm.New(nil)
- params := &cloudhsm.DescribeHsmInput{
- HsmArn: aws.String("HsmArn"),
- HsmSerialNumber: aws.String("HsmSerialNumber"),
- }
- resp, err := svc.DescribeHsm(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 ExampleCloudHSM_DescribeLunaClient() {
- svc := cloudhsm.New(nil)
- params := &cloudhsm.DescribeLunaClientInput{
- CertificateFingerprint: aws.String("CertificateFingerprint"),
- ClientArn: aws.String("ClientArn"),
- }
- resp, err := svc.DescribeLunaClient(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 ExampleCloudHSM_GetConfig() {
- svc := cloudhsm.New(nil)
- params := &cloudhsm.GetConfigInput{
- ClientArn: aws.String("ClientArn"), // Required
- ClientVersion: aws.String("ClientVersion"), // Required
- HapgList: []*string{ // Required
- aws.String("HapgArn"), // Required
- // More values...
- },
- }
- resp, err := svc.GetConfig(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 ExampleCloudHSM_ListAvailableZones() {
- svc := cloudhsm.New(nil)
- var params *cloudhsm.ListAvailableZonesInput
- resp, err := svc.ListAvailableZones(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 ExampleCloudHSM_ListHapgs() {
- svc := cloudhsm.New(nil)
- params := &cloudhsm.ListHapgsInput{
- NextToken: aws.String("PaginationToken"),
- }
- resp, err := svc.ListHapgs(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 ExampleCloudHSM_ListHsms() {
- svc := cloudhsm.New(nil)
- params := &cloudhsm.ListHsmsInput{
- NextToken: aws.String("PaginationToken"),
- }
- resp, err := svc.ListHsms(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 ExampleCloudHSM_ListLunaClients() {
- svc := cloudhsm.New(nil)
- params := &cloudhsm.ListLunaClientsInput{
- NextToken: aws.String("PaginationToken"),
- }
- resp, err := svc.ListLunaClients(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 ExampleCloudHSM_ModifyHapg() {
- svc := cloudhsm.New(nil)
- params := &cloudhsm.ModifyHapgInput{
- HapgArn: aws.String("HapgArn"), // Required
- Label: aws.String("Label"),
- PartitionSerialList: []*string{
- aws.String("PartitionSerial"), // Required
- // More values...
- },
- }
- resp, err := svc.ModifyHapg(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 ExampleCloudHSM_ModifyHsm() {
- svc := cloudhsm.New(nil)
- params := &cloudhsm.ModifyHsmInput{
- HsmArn: aws.String("HsmArn"), // Required
- EniIp: aws.String("IpAddress"),
- ExternalId: aws.String("ExternalId"),
- IamRoleArn: aws.String("IamRoleArn"),
- SubnetId: aws.String("SubnetId"),
- SyslogIp: aws.String("IpAddress"),
- }
- resp, err := svc.ModifyHsm(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 ExampleCloudHSM_ModifyLunaClient() {
- svc := cloudhsm.New(nil)
- params := &cloudhsm.ModifyLunaClientInput{
- Certificate: aws.String("Certificate"), // Required
- ClientArn: aws.String("ClientArn"), // Required
- }
- resp, err := svc.ModifyLunaClient(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)
- }
|