| 1 |
package slb |
| 2 |
|
| 3 |
import "github.com/denverdino/aliyungo/common" |
| 4 |
|
| 5 |
type UploadServerCertificateArgs struct { |
| 6 |
RegionId common.Region |
| 7 |
ServerCertificate string |
| 8 |
ServerCertificateName string |
| 9 |
PrivateKey string |
| 10 |
} |
| 11 |
|
| 12 |
type UploadServerCertificateResponse struct { |
| 13 |
common.Response |
| 14 |
ServerCertificateId string |
| 15 |
ServerCertificateName string |
| 16 |
Fingerprint string |
| 17 |
} |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
func (client *Client) UploadServerCertificate(args *UploadServerCertificateArgs) (response *UploadServerCertificateResponse, err error) { |
| 23 |
response = &UploadServerCertificateResponse{} |
| 24 |
err = client.Invoke("UploadServerCertificate", args, response) |
| 25 |
if err != nil { |
| 26 |
return nil, err |
| 27 |
} |
| 28 |
return response, err |
| 29 |
} |
| 30 |
|
| 31 |
type DeleteServerCertificateArgs struct { |
| 32 |
RegionId common.Region |
| 33 |
ServerCertificateId string |
| 34 |
} |
| 35 |
|
| 36 |
type DeleteServerCertificateResponse struct { |
| 37 |
common.Response |
| 38 |
} |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
func (client *Client) DeleteServerCertificate(regionId common.Region, serverCertificateId string) (err error) { |
| 44 |
args := &DeleteServerCertificateArgs{ |
| 45 |
RegionId: regionId, |
| 46 |
ServerCertificateId: serverCertificateId, |
| 47 |
} |
| 48 |
response := &DeleteServerCertificateResponse{} |
| 49 |
return client.Invoke("DeleteServerCertificate", args, response) |
| 50 |
} |
| 51 |
|
| 52 |
type SetServerCertificateNameArgs struct { |
| 53 |
RegionId common.Region |
| 54 |
ServerCertificateId string |
| 55 |
ServerCertificateName string |
| 56 |
} |
| 57 |
|
| 58 |
type SetServerCertificateNameResponse struct { |
| 59 |
common.Response |
| 60 |
} |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
func (client *Client) SetServerCertificateName(regionId common.Region, serverCertificateId string, name string) (err error) { |
| 66 |
args := &SetServerCertificateNameArgs{ |
| 67 |
RegionId: regionId, |
| 68 |
ServerCertificateId: serverCertificateId, |
| 69 |
ServerCertificateName: name, |
| 70 |
} |
| 71 |
response := &SetServerCertificateNameResponse{} |
| 72 |
return client.Invoke("SetServerCertificateName", args, response) |
| 73 |
} |
| 74 |
|
| 75 |
type DescribeServerCertificatesArgs struct { |
| 76 |
RegionId common.Region |
| 77 |
ServerCertificateId string |
| 78 |
} |
| 79 |
|
| 80 |
type ServerCertificateType struct { |
| 81 |
RegionId common.Region |
| 82 |
ServerCertificateId string |
| 83 |
ServerCertificateName string |
| 84 |
Fingerprint string |
| 85 |
} |
| 86 |
|
| 87 |
type DescribeServerCertificatesResponse struct { |
| 88 |
common.Response |
| 89 |
ServerCertificates struct { |
| 90 |
ServerCertificate []ServerCertificateType |
| 91 |
} |
| 92 |
} |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
func (client *Client) DescribeServerCertificatesArgs(regionId common.Region, serverCertificateId string) (serverCertificates []ServerCertificateType, err error) { |
| 98 |
args := &DescribeServerCertificatesArgs{ |
| 99 |
RegionId: regionId, |
| 100 |
ServerCertificateId: serverCertificateId, |
| 101 |
} |
| 102 |
response := &DescribeServerCertificatesResponse{} |
| 103 |
err = client.Invoke("DescribeServerCertificates", args, response) |
| 104 |
if err != nil { |
| 105 |
return nil, err |
| 106 |
} |
| 107 |
return response.ServerCertificates.ServerCertificate, err |
| 108 |
} |
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
func (client *Client) DescribeServerCertificates(args *DescribeServerCertificatesArgs) (response *DescribeServerCertificatesResponse, err error) { |
| 114 |
response = &DescribeServerCertificatesResponse{} |
| 115 |
err = client.Invoke("DescribeServerCertificates", args, response) |
| 116 |
if err != nil { |
| 117 |
return nil, err |
| 118 |
} |
| 119 |
return response, err |
| 120 |
} |