smtp_credentials
Creates, updates, deletes, gets or lists a smtp_credentials resource.
Overview​
| Name | smtp_credentials |
| Type | Resource |
| Id | oci.identity.smtp_credentials |
Fields​
The following fields are returned by SELECT queries:
- list
As the name suggests, an SmtpCredentialSummary object contains information about an SmtpCredential.<br />The SMTP credential is used for SMTP authentication with<br />the [Email Delivery Service](/Content/Email/Concepts/overview.htm).<br />
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the SMTP credential. |
description | string | The description you assign to the SMTP credential. Does not have to be unique, and it's changeable. (For tenancies that support identity domains) You can have an empty description. |
inactiveStatus | integer (int64) | The detailed status of INACTIVE lifecycleState. |
lifecycleState | string | The credential's current state. After creating a SMTP credential, make sure its lifecycleState changes from CREATING to ACTIVE before using it. (CREATING, ACTIVE, INACTIVE, DELETING, DELETED) |
timeCreated | string (date-time) | Date and time the SmtpCredential 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 SMTP credential belongs to. |
username | string | The SMTP user name. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | userId, region | Lists the SMTP credentials for the specified user. The returned object contains the credential's OCID,<br />the SMTP user name but not the SMTP password. The SMTP password is returned only upon creation.<br /> | |
create | insert | userId, region, description | opc-retry-token | Creates a new SMTP credential for the specified user. An SMTP credential has an SMTP user name and an SMTP password.<br />You must specify a description for the SMTP credential (although it can be an empty string). It does not<br />have to be unique, and you can change it anytime with<br />[UpdateSmtpCredential](#/en/identity/20160918/SmtpCredentialSummary/UpdateSmtpCredential).<br /> |
update | update | userId, smtpCredentialId, region | if-match | Updates the specified SMTP credential's description.<br /> |
delete | delete | userId, smtpCredentialId, region | if-match | Deletes the specified SMTP 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 |
|---|---|---|
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) |
smtpCredentialId | string | The OCID of the SMTP credential. |
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. |
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). |
SELECT examples​
- list
Lists the SMTP credentials for the specified user. The returned object contains the credential's OCID,<br />the SMTP user name but not the SMTP password. The SMTP password is returned only upon creation.<br />
SELECT
id,
description,
inactiveStatus,
lifecycleState,
timeCreated,
timeExpires,
userId,
username
FROM oci.identity.smtp_credentials
WHERE userId = '{{ userId }}' -- required
AND region = '{{ region }}' -- required
;
INSERT examples​
- create
- Manifest
Creates a new SMTP credential for the specified user. An SMTP credential has an SMTP user name and an SMTP password.<br />You must specify a description for the SMTP credential (although it can be an empty string). It does not<br />have to be unique, and you can change it anytime with<br />[UpdateSmtpCredential](#/en/identity/20160918/SmtpCredentialSummary/UpdateSmtpCredential).<br />
INSERT INTO oci.identity.smtp_credentials (
description,
userId,
region,
opc-retry-token
)
SELECT
'{{ description }}' /* required */,
'{{ userId }}',
'{{ region }}',
'{{ opc-retry-token }}'
RETURNING
id,
description,
inactiveStatus,
lifecycleState,
password,
timeCreated,
timeExpires,
userId,
username
;
# Description fields are for documentation purposes
- name: smtp_credentials
props:
- name: userId
value: "{{ userId }}"
description: Required parameter for the smtp_credentials resource.
- name: region
value: "{{ region }}"
description: Required parameter for the smtp_credentials resource.
- name: description
value: "{{ description }}"
description: |
The description you assign to the SMTP credentials during creation. Does not have to be unique, and it's changeable.
(For tenancies that support identity domains) You can have an empty description.
- 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).
UPDATE examples​
- update
Updates the specified SMTP credential's description.<br />
UPDATE oci.identity.smtp_credentials
SET
description = '{{ description }}'
WHERE
userId = '{{ userId }}' --required
AND smtpCredentialId = '{{ smtpCredentialId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
RETURNING
id,
description,
inactiveStatus,
lifecycleState,
timeCreated,
timeExpires,
userId,
username;
DELETE examples​
- delete
Deletes the specified SMTP credential for the specified user.<br />
DELETE FROM oci.identity.smtp_credentials
WHERE userId = '{{ userId }}' --required
AND smtpCredentialId = '{{ smtpCredentialId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
;