# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).

require 'oci'
require 'date'

# Create a default config using DEFAULT profile in default location
# Refer to https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File for more info
config = OCI::ConfigFileLoader.load_config

# Initialize service client with default config file
data_catalog_client = OCI::DataCatalog::DataCatalogClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
parse_connection_response =
  data_catalog_client.parse_connection(
    'ocid1.test.oc1..<unique_ID>EXAMPLE-catalogId-Value',
    'EXAMPLE-dataAssetKey-Value',
    OCI::DataCatalog::Models::ParseConnectionDetails.new(
      connection_detail:
        OCI::DataCatalog::Models::Connection.new(
          key: 'EXAMPLE-key-Value',
          description: 'EXAMPLE-description-Value',
          display_name: 'EXAMPLE-displayName-Value',
          time_created: DateTime.parse('2048-02-14T09:54:18.998Z'),
          time_updated: DateTime.parse('2012-05-22T13:36:39.653Z'),
          created_by_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-createdById-Value',
          updated_by_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-updatedById-Value',
          custom_property_members: [
            OCI::DataCatalog::Models::CustomPropertyGetUsage.new(
              key: 'EXAMPLE-key-Value',
              display_name: 'EXAMPLE-displayName-Value',
              description: 'EXAMPLE-description-Value',
              value: 'EXAMPLE-value-Value',
              data_type: 'TEXT',
              namespace_name: 'EXAMPLE-namespaceName-Value',
              namespace_key: 'EXAMPLE-namespaceKey-Value',
              is_multi_valued: true,
              is_hidden: false,
              is_editable: true,
              is_shown_in_list: false,
              is_event_enabled: true,
              is_list_type: true,
              allowed_values: %w[EXAMPLE--Value]
            )
          ],
          properties: {
            'EXAMPLE_KEY_C0Wwy' => { 'EXAMPLE_KEY_gBy2Y' => 'EXAMPLE--Value' }
          },
          external_key: 'EXAMPLE-externalKey-Value',
          time_status_updated: DateTime.parse('2043-06-20T05:48:36.381Z'),
          lifecycle_state: 'FAILED',
          is_default: false,
          data_asset_key: 'EXAMPLE-dataAssetKey-Value',
          type_key: 'EXAMPLE-typeKey-Value',
          uri: 'EXAMPLE-uri-Value'
        ),
      connection_payload: 'FA6qYlbdB6fc75aB8c1Q',
      wallet_secret_id:
        'ocid1.test.oc1..<unique_ID>EXAMPLE-walletSecretId-Value',
      wallet_secret_name: 'EXAMPLE-walletSecretName-Value'
    )
  )

# Get the data from response
puts "#{parse_connection_response.data}"

Was this article helpful?