oci 2.4.7 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -1
  3. data/lib/oci.rb +1 -0
  4. data/lib/oci/announcements_service/announcement_client.rb +47 -36
  5. data/lib/oci/announcements_service/announcements_service.rb +0 -1
  6. data/lib/oci/announcements_service/models/affected_resource.rb +4 -4
  7. data/lib/oci/announcements_service/models/announcement.rb +10 -14
  8. data/lib/oci/announcements_service/models/announcement_summary.rb +1 -1
  9. data/lib/oci/announcements_service/models/announcement_user_status_details.rb +5 -5
  10. data/lib/oci/announcements_service/models/announcements_collection.rb +3 -3
  11. data/lib/oci/announcements_service/models/base_announcement.rb +28 -18
  12. data/lib/oci/audit/audit_client.rb +17 -10
  13. data/lib/oci/container_engine/container_engine_client.rb +17 -10
  14. data/lib/oci/core/blockstorage_client.rb +17 -10
  15. data/lib/oci/core/compute_client.rb +17 -10
  16. data/lib/oci/core/compute_management_client.rb +17 -10
  17. data/lib/oci/core/models/create_subnet_details.rb +1 -1
  18. data/lib/oci/core/models/subnet.rb +1 -1
  19. data/lib/oci/core/virtual_network_client.rb +17 -10
  20. data/lib/oci/database/database_client.rb +17 -10
  21. data/lib/oci/dns/dns_client.rb +17 -10
  22. data/lib/oci/email/email_client.rb +17 -10
  23. data/lib/oci/file_storage/file_storage_client.rb +17 -10
  24. data/lib/oci/healthchecks/health_checks_client.rb +17 -10
  25. data/lib/oci/identity/identity_client.rb +17 -10
  26. data/lib/oci/key_management/kms_crypto_client.rb +4 -5
  27. data/lib/oci/key_management/kms_management_client.rb +7 -8
  28. data/lib/oci/key_management/kms_vault_client.rb +20 -13
  29. data/lib/oci/key_management/models/create_key_details.rb +34 -1
  30. data/lib/oci/key_management/models/create_vault_details.rb +34 -1
  31. data/lib/oci/key_management/models/key_version.rb +1 -1
  32. data/lib/oci/key_management/models/update_key_details.rb +37 -4
  33. data/lib/oci/key_management/models/update_vault_details.rb +37 -4
  34. data/lib/oci/load_balancer/load_balancer_client.rb +17 -10
  35. data/lib/oci/object_storage/object_storage_client.rb +17 -10
  36. data/lib/oci/regions.rb +20 -4
  37. data/lib/oci/resource_search/resource_search_client.rb +17 -10
  38. data/lib/oci/streaming/models/create_cursor_details.rb +205 -0
  39. data/lib/oci/streaming/models/create_group_cursor_details.rb +237 -0
  40. data/lib/oci/streaming/models/create_stream_details.rb +227 -0
  41. data/lib/oci/streaming/models/cursor.rb +150 -0
  42. data/lib/oci/streaming/models/group.rb +179 -0
  43. data/lib/oci/streaming/models/message.rb +199 -0
  44. data/lib/oci/streaming/models/partition_reservation.rb +192 -0
  45. data/lib/oci/streaming/models/put_messages_details.rb +149 -0
  46. data/lib/oci/{announcements_service/models/notification_followup_details.rb → streaming/models/put_messages_details_entry.rb} +19 -22
  47. data/lib/oci/streaming/models/put_messages_result.rb +165 -0
  48. data/lib/oci/streaming/models/put_messages_result_entry.rb +196 -0
  49. data/lib/oci/streaming/models/stream.rb +319 -0
  50. data/lib/oci/streaming/models/stream_summary.rb +291 -0
  51. data/lib/oci/streaming/models/update_group_details.rb +176 -0
  52. data/lib/oci/streaming/models/update_stream_details.rb +174 -0
  53. data/lib/oci/streaming/stream_admin_client.rb +432 -0
  54. data/lib/oci/streaming/stream_admin_client_composite_operations.rb +143 -0
  55. data/lib/oci/streaming/stream_client.rb +602 -0
  56. data/lib/oci/streaming/stream_client_composite_operations.rb +24 -0
  57. data/lib/oci/streaming/streaming.rb +35 -0
  58. data/lib/oci/streaming/util.rb +2 -0
  59. data/lib/oci/version.rb +1 -1
  60. data/lib/oci/waas/waas_client.rb +17 -10
  61. metadata +51 -3
@@ -25,20 +25,22 @@ module OCI
25
25
  # @return [String]
26
26
  attr_reader :region
27
27
 
28
- # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines
28
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
29
29
 
30
30
 
31
31
  # Creates a new AuditClient.
32
32
  # Notes:
33
33
  # If a config is not specified, then the global OCI.config will be used.
34
- # This client is not thread-safe
35
34
  #
36
- # A region must be specified in either the config or the region parameter. If specified in both,
37
- # then the region parameter will be used.
35
+ # This client is not thread-safe
38
36
  #
37
+ # Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the
38
+ # region. A region may be specified in the config or via or the region parameter. If specified in both, then the
39
+ # region parameter will be used.
39
40
  # @param [Config] config A Config object.
40
41
  # @param [String] region A region used to determine the service endpoint. This will usually
41
42
  # correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
43
+ # @param [String] endpoint The fully qualified endpoint URL
42
44
  # @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then
43
45
  # a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication,
44
46
  # so that the instance principals signer can be provided to the client
@@ -47,7 +49,7 @@ module OCI
47
49
  # @param [OCI::Retry::RetryConfig] retry_config The retry configuration for this service client. This represents the default retry configuration to
48
50
  # apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
49
51
  # will not perform any retries
50
- def initialize(config: nil, region: nil, signer: nil, proxy_settings: nil, retry_config: nil)
52
+ def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
51
53
  # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
52
54
  # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
53
55
  # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
@@ -73,11 +75,16 @@ module OCI
73
75
  @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
74
76
  @retry_config = retry_config
75
77
 
76
- region ||= config.region
77
- region ||= signer.region if signer.respond_to?(:region)
78
- self.region = region
78
+ if endpoint
79
+ @endpoint = endpoint + '/20160918'
80
+ else
81
+ region ||= config.region
82
+ region ||= signer.region if signer.respond_to?(:region)
83
+ self.region = region
84
+ end
85
+ logger.info "AuditClient endpoint set to '#{@endpoint}'." if logger
79
86
  end
80
- # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines
87
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
81
88
 
82
89
  # Set the region that will be used to determine the service endpoint.
83
90
  # This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
@@ -88,7 +95,7 @@ module OCI
88
95
  raise 'A region must be specified.' unless @region
89
96
 
90
97
  @endpoint = OCI::Regions.get_service_endpoint(@region, :AuditClient) + '/20160918'
91
- logger.info "AuditClient endpoint set to '#{endpoint}'." if logger
98
+ logger.info "AuditClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
92
99
  end
93
100
 
94
101
  # @return [Logger] The logger for this client. May be nil.
@@ -25,20 +25,22 @@ module OCI
25
25
  # @return [String]
26
26
  attr_reader :region
27
27
 
28
- # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines
28
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
29
29
 
30
30
 
31
31
  # Creates a new ContainerEngineClient.
32
32
  # Notes:
33
33
  # If a config is not specified, then the global OCI.config will be used.
34
- # This client is not thread-safe
35
34
  #
36
- # A region must be specified in either the config or the region parameter. If specified in both,
37
- # then the region parameter will be used.
35
+ # This client is not thread-safe
38
36
  #
37
+ # Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the
38
+ # region. A region may be specified in the config or via or the region parameter. If specified in both, then the
39
+ # region parameter will be used.
39
40
  # @param [Config] config A Config object.
40
41
  # @param [String] region A region used to determine the service endpoint. This will usually
41
42
  # correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
43
+ # @param [String] endpoint The fully qualified endpoint URL
42
44
  # @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then
43
45
  # a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication,
44
46
  # so that the instance principals signer can be provided to the client
@@ -47,7 +49,7 @@ module OCI
47
49
  # @param [OCI::Retry::RetryConfig] retry_config The retry configuration for this service client. This represents the default retry configuration to
48
50
  # apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
49
51
  # will not perform any retries
50
- def initialize(config: nil, region: nil, signer: nil, proxy_settings: nil, retry_config: nil)
52
+ def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
51
53
  # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
52
54
  # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
53
55
  # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
@@ -73,11 +75,16 @@ module OCI
73
75
  @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
74
76
  @retry_config = retry_config
75
77
 
76
- region ||= config.region
77
- region ||= signer.region if signer.respond_to?(:region)
78
- self.region = region
78
+ if endpoint
79
+ @endpoint = endpoint + '/20180222'
80
+ else
81
+ region ||= config.region
82
+ region ||= signer.region if signer.respond_to?(:region)
83
+ self.region = region
84
+ end
85
+ logger.info "ContainerEngineClient endpoint set to '#{@endpoint}'." if logger
79
86
  end
80
- # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines
87
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
81
88
 
82
89
  # Set the region that will be used to determine the service endpoint.
83
90
  # This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
@@ -88,7 +95,7 @@ module OCI
88
95
  raise 'A region must be specified.' unless @region
89
96
 
90
97
  @endpoint = OCI::Regions.get_service_endpoint(@region, :ContainerEngineClient) + '/20180222'
91
- logger.info "ContainerEngineClient endpoint set to '#{endpoint}'." if logger
98
+ logger.info "ContainerEngineClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
92
99
  end
93
100
 
94
101
  # @return [Logger] The logger for this client. May be nil.
@@ -25,20 +25,22 @@ module OCI
25
25
  # @return [String]
26
26
  attr_reader :region
27
27
 
28
- # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines
28
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
29
29
 
30
30
 
31
31
  # Creates a new BlockstorageClient.
32
32
  # Notes:
33
33
  # If a config is not specified, then the global OCI.config will be used.
34
- # This client is not thread-safe
35
34
  #
36
- # A region must be specified in either the config or the region parameter. If specified in both,
37
- # then the region parameter will be used.
35
+ # This client is not thread-safe
38
36
  #
37
+ # Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the
38
+ # region. A region may be specified in the config or via or the region parameter. If specified in both, then the
39
+ # region parameter will be used.
39
40
  # @param [Config] config A Config object.
40
41
  # @param [String] region A region used to determine the service endpoint. This will usually
41
42
  # correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
43
+ # @param [String] endpoint The fully qualified endpoint URL
42
44
  # @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then
43
45
  # a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication,
44
46
  # so that the instance principals signer can be provided to the client
@@ -47,7 +49,7 @@ module OCI
47
49
  # @param [OCI::Retry::RetryConfig] retry_config The retry configuration for this service client. This represents the default retry configuration to
48
50
  # apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
49
51
  # will not perform any retries
50
- def initialize(config: nil, region: nil, signer: nil, proxy_settings: nil, retry_config: nil)
52
+ def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
51
53
  # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
52
54
  # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
53
55
  # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
@@ -73,11 +75,16 @@ module OCI
73
75
  @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
74
76
  @retry_config = retry_config
75
77
 
76
- region ||= config.region
77
- region ||= signer.region if signer.respond_to?(:region)
78
- self.region = region
78
+ if endpoint
79
+ @endpoint = endpoint + '/20160918'
80
+ else
81
+ region ||= config.region
82
+ region ||= signer.region if signer.respond_to?(:region)
83
+ self.region = region
84
+ end
85
+ logger.info "BlockstorageClient endpoint set to '#{@endpoint}'." if logger
79
86
  end
80
- # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines
87
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
81
88
 
82
89
  # Set the region that will be used to determine the service endpoint.
83
90
  # This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
@@ -88,7 +95,7 @@ module OCI
88
95
  raise 'A region must be specified.' unless @region
89
96
 
90
97
  @endpoint = OCI::Regions.get_service_endpoint(@region, :BlockstorageClient) + '/20160918'
91
- logger.info "BlockstorageClient endpoint set to '#{endpoint}'." if logger
98
+ logger.info "BlockstorageClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
92
99
  end
93
100
 
94
101
  # @return [Logger] The logger for this client. May be nil.
@@ -25,20 +25,22 @@ module OCI
25
25
  # @return [String]
26
26
  attr_reader :region
27
27
 
28
- # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines
28
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
29
29
 
30
30
 
31
31
  # Creates a new ComputeClient.
32
32
  # Notes:
33
33
  # If a config is not specified, then the global OCI.config will be used.
34
- # This client is not thread-safe
35
34
  #
36
- # A region must be specified in either the config or the region parameter. If specified in both,
37
- # then the region parameter will be used.
35
+ # This client is not thread-safe
38
36
  #
37
+ # Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the
38
+ # region. A region may be specified in the config or via or the region parameter. If specified in both, then the
39
+ # region parameter will be used.
39
40
  # @param [Config] config A Config object.
40
41
  # @param [String] region A region used to determine the service endpoint. This will usually
41
42
  # correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
43
+ # @param [String] endpoint The fully qualified endpoint URL
42
44
  # @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then
43
45
  # a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication,
44
46
  # so that the instance principals signer can be provided to the client
@@ -47,7 +49,7 @@ module OCI
47
49
  # @param [OCI::Retry::RetryConfig] retry_config The retry configuration for this service client. This represents the default retry configuration to
48
50
  # apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
49
51
  # will not perform any retries
50
- def initialize(config: nil, region: nil, signer: nil, proxy_settings: nil, retry_config: nil)
52
+ def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
51
53
  # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
52
54
  # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
53
55
  # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
@@ -73,11 +75,16 @@ module OCI
73
75
  @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
74
76
  @retry_config = retry_config
75
77
 
76
- region ||= config.region
77
- region ||= signer.region if signer.respond_to?(:region)
78
- self.region = region
78
+ if endpoint
79
+ @endpoint = endpoint + '/20160918'
80
+ else
81
+ region ||= config.region
82
+ region ||= signer.region if signer.respond_to?(:region)
83
+ self.region = region
84
+ end
85
+ logger.info "ComputeClient endpoint set to '#{@endpoint}'." if logger
79
86
  end
80
- # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines
87
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
81
88
 
82
89
  # Set the region that will be used to determine the service endpoint.
83
90
  # This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
@@ -88,7 +95,7 @@ module OCI
88
95
  raise 'A region must be specified.' unless @region
89
96
 
90
97
  @endpoint = OCI::Regions.get_service_endpoint(@region, :ComputeClient) + '/20160918'
91
- logger.info "ComputeClient endpoint set to '#{endpoint}'." if logger
98
+ logger.info "ComputeClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
92
99
  end
93
100
 
94
101
  # @return [Logger] The logger for this client. May be nil.
@@ -25,20 +25,22 @@ module OCI
25
25
  # @return [String]
26
26
  attr_reader :region
27
27
 
28
- # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines
28
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
29
29
 
30
30
 
31
31
  # Creates a new ComputeManagementClient.
32
32
  # Notes:
33
33
  # If a config is not specified, then the global OCI.config will be used.
34
- # This client is not thread-safe
35
34
  #
36
- # A region must be specified in either the config or the region parameter. If specified in both,
37
- # then the region parameter will be used.
35
+ # This client is not thread-safe
38
36
  #
37
+ # Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the
38
+ # region. A region may be specified in the config or via or the region parameter. If specified in both, then the
39
+ # region parameter will be used.
39
40
  # @param [Config] config A Config object.
40
41
  # @param [String] region A region used to determine the service endpoint. This will usually
41
42
  # correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
43
+ # @param [String] endpoint The fully qualified endpoint URL
42
44
  # @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then
43
45
  # a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication,
44
46
  # so that the instance principals signer can be provided to the client
@@ -47,7 +49,7 @@ module OCI
47
49
  # @param [OCI::Retry::RetryConfig] retry_config The retry configuration for this service client. This represents the default retry configuration to
48
50
  # apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
49
51
  # will not perform any retries
50
- def initialize(config: nil, region: nil, signer: nil, proxy_settings: nil, retry_config: nil)
52
+ def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
51
53
  # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
52
54
  # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
53
55
  # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
@@ -73,11 +75,16 @@ module OCI
73
75
  @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
74
76
  @retry_config = retry_config
75
77
 
76
- region ||= config.region
77
- region ||= signer.region if signer.respond_to?(:region)
78
- self.region = region
78
+ if endpoint
79
+ @endpoint = endpoint + '/20160918'
80
+ else
81
+ region ||= config.region
82
+ region ||= signer.region if signer.respond_to?(:region)
83
+ self.region = region
84
+ end
85
+ logger.info "ComputeManagementClient endpoint set to '#{@endpoint}'." if logger
79
86
  end
80
- # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines
87
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
81
88
 
82
89
  # Set the region that will be used to determine the service endpoint.
83
90
  # This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
@@ -88,7 +95,7 @@ module OCI
88
95
  raise 'A region must be specified.' unless @region
89
96
 
90
97
  @endpoint = OCI::Regions.get_service_endpoint(@region, :ComputeManagementClient) + '/20160918'
91
- logger.info "ComputeManagementClient endpoint set to '#{endpoint}'." if logger
98
+ logger.info "ComputeManagementClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
92
99
  end
93
100
 
94
101
  # @return [Logger] The logger for this client. May be nil.
@@ -6,7 +6,7 @@ require 'date'
6
6
  module OCI
7
7
  # CreateSubnetDetails model.
8
8
  class Core::Models::CreateSubnetDetails # rubocop:disable Metrics/LineLength
9
- # **[Required]** The availability domain to contain the subnet.
9
+ # The availability domain to contain the subnet.
10
10
  #
11
11
  # Example: `Uocm:PHX-AD-1`
12
12
  #
@@ -27,7 +27,7 @@ module OCI
27
27
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
28
28
  ].freeze
29
29
 
30
- # **[Required]** The subnet's availability domain.
30
+ # The subnet's availability domain.
31
31
  #
32
32
  # Example: `Uocm:PHX-AD-1`
33
33
  #
@@ -25,20 +25,22 @@ module OCI
25
25
  # @return [String]
26
26
  attr_reader :region
27
27
 
28
- # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines
28
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
29
29
 
30
30
 
31
31
  # Creates a new VirtualNetworkClient.
32
32
  # Notes:
33
33
  # If a config is not specified, then the global OCI.config will be used.
34
- # This client is not thread-safe
35
34
  #
36
- # A region must be specified in either the config or the region parameter. If specified in both,
37
- # then the region parameter will be used.
35
+ # This client is not thread-safe
38
36
  #
37
+ # Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the
38
+ # region. A region may be specified in the config or via or the region parameter. If specified in both, then the
39
+ # region parameter will be used.
39
40
  # @param [Config] config A Config object.
40
41
  # @param [String] region A region used to determine the service endpoint. This will usually
41
42
  # correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
43
+ # @param [String] endpoint The fully qualified endpoint URL
42
44
  # @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then
43
45
  # a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication,
44
46
  # so that the instance principals signer can be provided to the client
@@ -47,7 +49,7 @@ module OCI
47
49
  # @param [OCI::Retry::RetryConfig] retry_config The retry configuration for this service client. This represents the default retry configuration to
48
50
  # apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
49
51
  # will not perform any retries
50
- def initialize(config: nil, region: nil, signer: nil, proxy_settings: nil, retry_config: nil)
52
+ def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
51
53
  # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
52
54
  # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
53
55
  # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
@@ -73,11 +75,16 @@ module OCI
73
75
  @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
74
76
  @retry_config = retry_config
75
77
 
76
- region ||= config.region
77
- region ||= signer.region if signer.respond_to?(:region)
78
- self.region = region
78
+ if endpoint
79
+ @endpoint = endpoint + '/20160918'
80
+ else
81
+ region ||= config.region
82
+ region ||= signer.region if signer.respond_to?(:region)
83
+ self.region = region
84
+ end
85
+ logger.info "VirtualNetworkClient endpoint set to '#{@endpoint}'." if logger
79
86
  end
80
- # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines
87
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
81
88
 
82
89
  # Set the region that will be used to determine the service endpoint.
83
90
  # This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
@@ -88,7 +95,7 @@ module OCI
88
95
  raise 'A region must be specified.' unless @region
89
96
 
90
97
  @endpoint = OCI::Regions.get_service_endpoint(@region, :VirtualNetworkClient) + '/20160918'
91
- logger.info "VirtualNetworkClient endpoint set to '#{endpoint}'." if logger
98
+ logger.info "VirtualNetworkClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
92
99
  end
93
100
 
94
101
  # @return [Logger] The logger for this client. May be nil.
@@ -25,20 +25,22 @@ module OCI
25
25
  # @return [String]
26
26
  attr_reader :region
27
27
 
28
- # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines
28
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
29
29
 
30
30
 
31
31
  # Creates a new DatabaseClient.
32
32
  # Notes:
33
33
  # If a config is not specified, then the global OCI.config will be used.
34
- # This client is not thread-safe
35
34
  #
36
- # A region must be specified in either the config or the region parameter. If specified in both,
37
- # then the region parameter will be used.
35
+ # This client is not thread-safe
38
36
  #
37
+ # Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the
38
+ # region. A region may be specified in the config or via or the region parameter. If specified in both, then the
39
+ # region parameter will be used.
39
40
  # @param [Config] config A Config object.
40
41
  # @param [String] region A region used to determine the service endpoint. This will usually
41
42
  # correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
43
+ # @param [String] endpoint The fully qualified endpoint URL
42
44
  # @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then
43
45
  # a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication,
44
46
  # so that the instance principals signer can be provided to the client
@@ -47,7 +49,7 @@ module OCI
47
49
  # @param [OCI::Retry::RetryConfig] retry_config The retry configuration for this service client. This represents the default retry configuration to
48
50
  # apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
49
51
  # will not perform any retries
50
- def initialize(config: nil, region: nil, signer: nil, proxy_settings: nil, retry_config: nil)
52
+ def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
51
53
  # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
52
54
  # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
53
55
  # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
@@ -73,11 +75,16 @@ module OCI
73
75
  @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
74
76
  @retry_config = retry_config
75
77
 
76
- region ||= config.region
77
- region ||= signer.region if signer.respond_to?(:region)
78
- self.region = region
78
+ if endpoint
79
+ @endpoint = endpoint + '/20160918'
80
+ else
81
+ region ||= config.region
82
+ region ||= signer.region if signer.respond_to?(:region)
83
+ self.region = region
84
+ end
85
+ logger.info "DatabaseClient endpoint set to '#{@endpoint}'." if logger
79
86
  end
80
- # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines
87
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
81
88
 
82
89
  # Set the region that will be used to determine the service endpoint.
83
90
  # This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
@@ -88,7 +95,7 @@ module OCI
88
95
  raise 'A region must be specified.' unless @region
89
96
 
90
97
  @endpoint = OCI::Regions.get_service_endpoint(@region, :DatabaseClient) + '/20160918'
91
- logger.info "DatabaseClient endpoint set to '#{endpoint}'." if logger
98
+ logger.info "DatabaseClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
92
99
  end
93
100
 
94
101
  # @return [Logger] The logger for this client. May be nil.