@@ -64,8 +64,19 @@ type SSLOffloadProfiles struct {
64
64
PagedResult
65
65
}
66
66
67
- // Request body when createing an SSL-offload profile.
67
+ // Request body when creating an SSL-offload profile.
68
68
type createSSLOffloadProfile struct {
69
+ Name string `json:"name"`
70
+ Description string `json:"description"`
71
+ Ciphers * string `json:"ciphers"`
72
+ SSLDomainCertificateID string `json:"sslDomainCertificateId"`
73
+ SSLCertificateChainID string `json:"sslCertificateChainId,omitempty"`
74
+ NetworkDomainID string `json:"networkDomainId"`
75
+ }
76
+
77
+ // Request body when editing an SSL-offload profile.
78
+ type editSSLOffloadProfile struct {
79
+ ID string `json:"id"`
69
80
Name string `json:"name"`
70
81
Description string `json:"description"`
71
82
Ciphers string `json:"ciphers"`
@@ -169,7 +180,7 @@ func (client *Client) GetSSLOffloadProfile(id string) (pool *SSLOffloadProfile,
169
180
}
170
181
171
182
// CreateSSLOffloadProfile creates an SSL-offload profile in a network domain.
172
- func (client * Client ) CreateSSLOffloadProfile (networkDomainID string , name string , description string , ciphers string , sslDomainCertificateID string , sslCertificateChainID string ) (offloadProfileID string , err error ) {
183
+ func (client * Client ) CreateSSLOffloadProfile (networkDomainID string , name string , description string , ciphers * string , sslDomainCertificateID string , sslCertificateChainID string ) (offloadProfileID string , err error ) {
173
184
organizationID , err := client .getOrganizationID ()
174
185
if err != nil {
175
186
return "" , err
@@ -209,6 +220,42 @@ func (client *Client) CreateSSLOffloadProfile(networkDomainID string, name strin
209
220
return * sslOffloadProfileIDMessage , nil
210
221
}
211
222
223
+ // EditSSLOffloadProfile updates an existing SSL-offload profile.
224
+ func (client * Client ) EditSSLOffloadProfile (sslOffloadProfile SSLOffloadProfile ) error {
225
+ organizationID , err := client .getOrganizationID ()
226
+ if err != nil {
227
+ return err
228
+ }
229
+
230
+ requestURI := fmt .Sprintf ("%s/networkDomainVip/editSslOffloadProfile" ,
231
+ url .QueryEscape (organizationID ),
232
+ )
233
+ request , err := client .newRequestV26 (requestURI , http .MethodPost , & editSSLOffloadProfile {
234
+ ID : sslOffloadProfile .ID ,
235
+ Name : sslOffloadProfile .Name ,
236
+ Description : sslOffloadProfile .Description ,
237
+ Ciphers : sslOffloadProfile .Ciphers ,
238
+ SSLDomainCertificateID : sslOffloadProfile .SSLDomainCertificate .ID ,
239
+ SSLCertificateChainID : sslOffloadProfile .SSLCertificateChain .ID ,
240
+ NetworkDomainID : sslOffloadProfile .NetworkDomainID ,
241
+ })
242
+ responseBody , statusCode , err := client .executeRequest (request )
243
+ if err != nil {
244
+ return err
245
+ }
246
+
247
+ apiResponse , err := readAPIResponseAsJSON (responseBody , statusCode )
248
+ if err != nil {
249
+ return err
250
+ }
251
+
252
+ if apiResponse .ResponseCode != ResponseCodeOK {
253
+ return apiResponse .ToError ("Request to edit SSL-offload profile '%s' ('%s') failed with status code %d (%s): %s" , sslOffloadProfile .Name , sslOffloadProfile .ID , statusCode , apiResponse .ResponseCode , apiResponse .Message )
254
+ }
255
+
256
+ return nil
257
+ }
258
+
212
259
// DeleteSSLOffloadProfile deletes an existing SSL-offload profile.
213
260
//
214
261
// Returns an error if the operation was not successful.
0 commit comments