Method: OCI::Ons::NotificationDataPlaneClient#list_subscriptions

Defined in:
lib/oci/ons/notification_data_plane_client.rb

#list_subscriptions(compartment_id, opts = {}) ⇒ Response

Note:

Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/ons/list_subscriptions.rb.html) to see an example of how to use list_subscriptions API.

Lists the subscriptions in the specified compartment or topic.

Transactions Per Minute (TPM) per-tenancy limit for this operation: 60.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :topic_id (String)

    Return all subscriptions that are subscribed to the given topic OCID. Either this query parameter or the compartmentId query parameter must be set.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see [List Pagination](docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see [List Pagination](docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).

    (default to 10)
    
  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
# File 'lib/oci/ons/notification_data_plane_client.rb', line 550

def list_subscriptions(compartment_id, opts = {})
  logger.debug 'Calling operation NotificationDataPlaneClient#list_subscriptions.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_subscriptions." if compartment_id.nil?

  path = '/subscriptions'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:topicId] = opts[:topic_id] if opts[:topic_id]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'NotificationDataPlaneClient#list_subscriptions') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Ons::Models::SubscriptionSummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end