Skip to main content

smtp_credentials

Creates, updates, deletes, gets or lists a smtp_credentials resource.

Overview​

Namesmtp_credentials
TypeResource
Idoci.identity.smtp_credentials

Fields​

The following fields are returned by SELECT queries:

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 />

NameDatatypeDescription
idstringThe OCID of the SMTP credential.
descriptionstringThe 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.
inactiveStatusinteger (int64)The detailed status of INACTIVE lifecycleState.
lifecycleStatestringThe 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)
timeCreatedstring (date-time)Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
timeExpiresstring (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
userIdstringThe OCID of the user the SMTP credential belongs to.
usernamestringThe SMTP user name.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectuserId, regionLists 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 />
createinsertuserId, region, descriptionopc-retry-tokenCreates 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 />
updateupdateuserId, smtpCredentialId, regionif-matchUpdates the specified SMTP credential's description.<br />
deletedeleteuserId, smtpCredentialId, regionif-matchDeletes 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.

NameDatatypeDescription
regionstringOCI 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)
smtpCredentialIdstringThe OCID of the SMTP credential.
userIdstringThe OCID of the user.
if-matchstringFor 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-tokenstringA 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​

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​

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
;

UPDATE examples​

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​

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 }}'
;