Method: IbmCloudDatabases::CloudDatabasesV5#kill_connections

Defined in:
lib/ibm_cloud_databases/cloud_databases_v5.rb

#kill_connections(id: ) ⇒ IBMCloudSdkCore::DetailedResponse

Kill connections to a PostgreSQL or EnterpriseDB deployment. Closes all the connections on a deployment. Available for PostgreSQL and

EnterpriseDB ONLY.

Parameters:

  • id (String) (defaults to: )

    Deployment ID.

Returns:

  • (IBMCloudSdkCore::DetailedResponse)

    A ‘IBMCloudSdkCore::DetailedResponse` object representing the response.

Raises:

  • (ArgumentError)


802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
# File 'lib/ibm_cloud_databases/cloud_databases_v5.rb', line 802

def kill_connections(id:)
  raise ArgumentError.new("id must be provided") if id.nil?

  headers = {
  }
  sdk_headers = Common.new.get_sdk_headers("cloud_databases", "V5", "kill_connections")
  headers.merge!(sdk_headers)

  method_url = "/deployments/%s/management/database_connections" % [ERB::Util.url_encode(id)]

  response = request(
    method: "DELETE",
    url: method_url,
    headers: headers,
    accept_json: true
  )
  response
end