@@ -92,6 +92,69 @@ func (client *ConfigClient) ConfigurationProvider() *common.ConfigurationProvide
92
92
return client .config
93
93
}
94
94
95
+ // CopyConfiguration Fast importing configuration items to a destination APM domain ID.
96
+ //
97
+ // # See also
98
+ //
99
+ // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmconfig/CopyConfiguration.go.html to see an example of how to use CopyConfiguration API.
100
+ // A default retry strategy applies to this operation CopyConfiguration()
101
+ func (client ConfigClient ) CopyConfiguration (ctx context.Context , request CopyConfigurationRequest ) (response CopyConfigurationResponse , err error ) {
102
+ var ociResponse common.OCIResponse
103
+ policy := common .DefaultRetryPolicy ()
104
+ if client .RetryPolicy () != nil {
105
+ policy = * client .RetryPolicy ()
106
+ }
107
+ if request .RetryPolicy () != nil {
108
+ policy = * request .RetryPolicy ()
109
+ }
110
+
111
+ if ! (request .OpcRetryToken != nil && * request .OpcRetryToken != "" ) {
112
+ request .OpcRetryToken = common .String (common .RetryToken ())
113
+ }
114
+
115
+ ociResponse , err = common .Retry (ctx , request , client .copyConfiguration , policy )
116
+ if err != nil {
117
+ if ociResponse != nil {
118
+ if httpResponse := ociResponse .HTTPResponse (); httpResponse != nil {
119
+ opcRequestId := httpResponse .Header .Get ("opc-request-id" )
120
+ response = CopyConfigurationResponse {RawResponse : httpResponse , OpcRequestId : & opcRequestId }
121
+ } else {
122
+ response = CopyConfigurationResponse {}
123
+ }
124
+ }
125
+ return
126
+ }
127
+ if convertedResponse , ok := ociResponse .(CopyConfigurationResponse ); ok {
128
+ response = convertedResponse
129
+ } else {
130
+ err = fmt .Errorf ("failed to convert OCIResponse into CopyConfigurationResponse" )
131
+ }
132
+ return
133
+ }
134
+
135
+ // copyConfiguration implements the OCIOperation interface (enables retrying operations)
136
+ func (client ConfigClient ) copyConfiguration (ctx context.Context , request common.OCIRequest , binaryReqBody * common.OCIReadSeekCloser , extraHeaders map [string ]string ) (common.OCIResponse , error ) {
137
+
138
+ httpRequest , err := request .HTTPRequest (http .MethodPost , "/actions/copyConfiguration" , binaryReqBody , extraHeaders )
139
+ if err != nil {
140
+ return nil , err
141
+ }
142
+
143
+ var response CopyConfigurationResponse
144
+ var httpResponse * http.Response
145
+ httpResponse , err = client .Call (ctx , & httpRequest )
146
+ defer common .CloseBodyIfValid (httpResponse )
147
+ response .RawResponse = httpResponse
148
+ if err != nil {
149
+ apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/apm-config/20210201/ExportConfigurationDetails/CopyConfiguration"
150
+ err = common .PostProcessServiceError (err , "Config" , "CopyConfiguration" , apiReferenceLink )
151
+ return response , err
152
+ }
153
+
154
+ err = common .UnmarshalResponse (httpResponse , & response )
155
+ return response , err
156
+ }
157
+
95
158
// CreateConfig Creates a new configuration item.
96
159
//
97
160
// # See also
@@ -213,6 +276,69 @@ func (client ConfigClient) deleteConfig(ctx context.Context, request common.OCIR
213
276
return response , err
214
277
}
215
278
279
+ // ExportConfiguration Exports configurations for the whole domain by domainId.
280
+ //
281
+ // # See also
282
+ //
283
+ // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmconfig/ExportConfiguration.go.html to see an example of how to use ExportConfiguration API.
284
+ // A default retry strategy applies to this operation ExportConfiguration()
285
+ func (client ConfigClient ) ExportConfiguration (ctx context.Context , request ExportConfigurationRequest ) (response ExportConfigurationResponse , err error ) {
286
+ var ociResponse common.OCIResponse
287
+ policy := common .DefaultRetryPolicy ()
288
+ if client .RetryPolicy () != nil {
289
+ policy = * client .RetryPolicy ()
290
+ }
291
+ if request .RetryPolicy () != nil {
292
+ policy = * request .RetryPolicy ()
293
+ }
294
+
295
+ if ! (request .OpcRetryToken != nil && * request .OpcRetryToken != "" ) {
296
+ request .OpcRetryToken = common .String (common .RetryToken ())
297
+ }
298
+
299
+ ociResponse , err = common .Retry (ctx , request , client .exportConfiguration , policy )
300
+ if err != nil {
301
+ if ociResponse != nil {
302
+ if httpResponse := ociResponse .HTTPResponse (); httpResponse != nil {
303
+ opcRequestId := httpResponse .Header .Get ("opc-request-id" )
304
+ response = ExportConfigurationResponse {RawResponse : httpResponse , OpcRequestId : & opcRequestId }
305
+ } else {
306
+ response = ExportConfigurationResponse {}
307
+ }
308
+ }
309
+ return
310
+ }
311
+ if convertedResponse , ok := ociResponse .(ExportConfigurationResponse ); ok {
312
+ response = convertedResponse
313
+ } else {
314
+ err = fmt .Errorf ("failed to convert OCIResponse into ExportConfigurationResponse" )
315
+ }
316
+ return
317
+ }
318
+
319
+ // exportConfiguration implements the OCIOperation interface (enables retrying operations)
320
+ func (client ConfigClient ) exportConfiguration (ctx context.Context , request common.OCIRequest , binaryReqBody * common.OCIReadSeekCloser , extraHeaders map [string ]string ) (common.OCIResponse , error ) {
321
+
322
+ httpRequest , err := request .HTTPRequest (http .MethodPost , "/actions/exportConfiguration" , binaryReqBody , extraHeaders )
323
+ if err != nil {
324
+ return nil , err
325
+ }
326
+
327
+ var response ExportConfigurationResponse
328
+ var httpResponse * http.Response
329
+ httpResponse , err = client .Call (ctx , & httpRequest )
330
+ defer common .CloseBodyIfValid (httpResponse )
331
+ response .RawResponse = httpResponse
332
+ if err != nil {
333
+ apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/apm-config/20210201/ExportConfigurationDetails/ExportConfiguration"
334
+ err = common .PostProcessServiceError (err , "Config" , "ExportConfiguration" , apiReferenceLink )
335
+ return response , err
336
+ }
337
+
338
+ err = common .UnmarshalResponse (httpResponse , & response )
339
+ return response , err
340
+ }
341
+
216
342
// GetConfig Gets the configuration item identified by the OCID.
217
343
//
218
344
// # See also
@@ -271,6 +397,69 @@ func (client ConfigClient) getConfig(ctx context.Context, request common.OCIRequ
271
397
return response , err
272
398
}
273
399
400
+ // ImportConfiguration Import configurations Item(s) with its dependencies into a destination domain.
401
+ //
402
+ // # See also
403
+ //
404
+ // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmconfig/ImportConfiguration.go.html to see an example of how to use ImportConfiguration API.
405
+ // A default retry strategy applies to this operation ImportConfiguration()
406
+ func (client ConfigClient ) ImportConfiguration (ctx context.Context , request ImportConfigurationRequest ) (response ImportConfigurationResponse , err error ) {
407
+ var ociResponse common.OCIResponse
408
+ policy := common .DefaultRetryPolicy ()
409
+ if client .RetryPolicy () != nil {
410
+ policy = * client .RetryPolicy ()
411
+ }
412
+ if request .RetryPolicy () != nil {
413
+ policy = * request .RetryPolicy ()
414
+ }
415
+
416
+ if ! (request .OpcRetryToken != nil && * request .OpcRetryToken != "" ) {
417
+ request .OpcRetryToken = common .String (common .RetryToken ())
418
+ }
419
+
420
+ ociResponse , err = common .Retry (ctx , request , client .importConfiguration , policy )
421
+ if err != nil {
422
+ if ociResponse != nil {
423
+ if httpResponse := ociResponse .HTTPResponse (); httpResponse != nil {
424
+ opcRequestId := httpResponse .Header .Get ("opc-request-id" )
425
+ response = ImportConfigurationResponse {RawResponse : httpResponse , OpcRequestId : & opcRequestId }
426
+ } else {
427
+ response = ImportConfigurationResponse {}
428
+ }
429
+ }
430
+ return
431
+ }
432
+ if convertedResponse , ok := ociResponse .(ImportConfigurationResponse ); ok {
433
+ response = convertedResponse
434
+ } else {
435
+ err = fmt .Errorf ("failed to convert OCIResponse into ImportConfigurationResponse" )
436
+ }
437
+ return
438
+ }
439
+
440
+ // importConfiguration implements the OCIOperation interface (enables retrying operations)
441
+ func (client ConfigClient ) importConfiguration (ctx context.Context , request common.OCIRequest , binaryReqBody * common.OCIReadSeekCloser , extraHeaders map [string ]string ) (common.OCIResponse , error ) {
442
+
443
+ httpRequest , err := request .HTTPRequest (http .MethodPost , "/actions/importConfiguration" , binaryReqBody , extraHeaders )
444
+ if err != nil {
445
+ return nil , err
446
+ }
447
+
448
+ var response ImportConfigurationResponse
449
+ var httpResponse * http.Response
450
+ httpResponse , err = client .Call (ctx , & httpRequest )
451
+ defer common .CloseBodyIfValid (httpResponse )
452
+ response .RawResponse = httpResponse
453
+ if err != nil {
454
+ apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/apm-config/20210201/ImportConfigurationDetails/ImportConfiguration"
455
+ err = common .PostProcessServiceError (err , "Config" , "ImportConfiguration" , apiReferenceLink )
456
+ return response , err
457
+ }
458
+
459
+ err = common .UnmarshalResponse (httpResponse , & response )
460
+ return response , err
461
+ }
462
+
274
463
// ListConfigs Returns all configuration items, which can optionally be filtered by configuration type.
275
464
//
276
465
// # See also
0 commit comments