db_credentials
Creates, updates, deletes, gets or lists a db_credentials resource.
Overview​
| Name | db_credentials |
| Type | Resource |
| Id | oci.identity.db_credentials |
Fields​
The following fields are returned by SELECT queries:
- list
As the name suggests, an DbCredentialSummary object contains information about an DbCredential.<br />The DB credential is used for DB authentication with<br />the [DB Service].<br />
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the DB credential. |
description | string | The description you assign to the DB credential. Does not have to be unique, and it's changeable. (For tenancies that support identity domains) You can have an empty description. |
lifecycleState | string | The credential's current state. After creating a DB credential, make sure its lifecycleState changes from CREATING to ACTIVE before using it. (x-obmcs-enumref: #/definitions/DbCredential/lifecycleState) |
timeCreated | string (date-time) | Date and time the DbCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z |
timeExpires | string (date-time) | Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z |
userId | string | The OCID of the user the DB credential belongs to. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | userId, region | opc-request-id, page, limit, name, sortBy, sortOrder, lifecycleState | Lists the DB credentials for the specified user. The returned object contains the credential's OCID<br /> |
create | insert | userId, region, password, description | opc-request-id, opc-retry-token | Creates a new DB credential for the specified user.<br /> |
delete | delete | userId, dbCredentialId, region | opc-request-id, if-match | Deletes the specified DB credential for the specified user.<br /> |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
dbCredentialId | string | The OCID of the DB credential. |
region | string | OCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION) |
userId | string | The OCID of the user. |
if-match | string | For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value. |
lifecycleState | string | A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. |
limit | integer | The maximum number of items to return in a paginated "List" call. |
name | string | A filter to only return resources that match the given name exactly. |
opc-request-id | string | Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. |
opc-retry-token | string | A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected). |
page | string | The value of the opc-next-page response header from the previous "List" call. |
sortBy | string | The field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive. Note: In general, some "List" operations (for example, ListInstances) let you optionally filter by Availability Domain if the scope of the resource type is within a single Availability Domain. If you call one of these "List" operations without specifying an Availability Domain, the resources are grouped by Availability Domain, then sorted. |
sortOrder | string | The sort order to use, either ascending (ASC) or descending (DESC). The NAME sort order is case sensitive. |
SELECT examples​
- list
Lists the DB credentials for the specified user. The returned object contains the credential's OCID<br />
SELECT
id,
description,
lifecycleState,
timeCreated,
timeExpires,
userId
FROM oci.identity.db_credentials
WHERE userId = '{{ userId }}' -- required
AND region = '{{ region }}' -- required
AND opc-request-id = '{{ opc-request-id }}'
AND page = '{{ page }}'
AND limit = '{{ limit }}'
AND name = '{{ name }}'
AND sortBy = '{{ sortBy }}'
AND sortOrder = '{{ sortOrder }}'
AND lifecycleState = '{{ lifecycleState }}'
;
INSERT examples​
- create
- Manifest
Creates a new DB credential for the specified user.<br />
INSERT INTO oci.identity.db_credentials (
description,
password,
userId,
region,
opc-request-id,
opc-retry-token
)
SELECT
'{{ description }}' /* required */,
'{{ password }}' /* required */,
'{{ userId }}',
'{{ region }}',
'{{ opc-request-id }}',
'{{ opc-retry-token }}'
RETURNING
id,
lifecycleDetails,
lifecycleState,
timeCreated,
timeExpires,
userId
;
# Description fields are for documentation purposes
- name: db_credentials
props:
- name: userId
value: "{{ userId }}"
description: Required parameter for the db_credentials resource.
- name: region
value: "{{ region }}"
description: Required parameter for the db_credentials resource.
- name: description
value: "{{ description }}"
description: |
The description you assign to the DB credentials during creation.
(For tenancies that support identity domains) You can have an empty description.
- name: password
value: "{{ password }}"
description: |
The password for the DB credentials during creation.
- name: opc-request-id
value: "{{ opc-request-id }}"
description: Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
description: Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
- name: opc-retry-token
value: "{{ opc-retry-token }}"
description: A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
description: A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
DELETE examples​
- delete
Deletes the specified DB credential for the specified user.<br />
DELETE FROM oci.identity.db_credentials
WHERE userId = '{{ userId }}' --required
AND dbCredentialId = '{{ dbCredentialId }}' --required
AND region = '{{ region }}' --required
AND opc-request-id = '{{ opc-request-id }}'
AND if-match = '{{ if-match }}'
;