streams
Creates, updates, deletes, gets or lists a streams resource.
Overview​
| Name | streams |
| Type | Resource |
| Id | oci.streaming.streams |
Fields​
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the stream. (example: ocid1.stream.realm.region.mnopqr789) |
name | string | The name of the stream. Avoid entering confidential information. Example: TelemetryEvents (example: TelemetryEvents) |
compartmentId | string | The OCID of the stream. (example: ocid1.compinstance.realm.region.zxcvbn432765) |
definedTags | object | Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: `{"Operations": {"CostCenter": "42"}}' |
freeformTags | object | Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Exists for cross-compatibility only. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"} |
lifecycleState | string | The current state of the stream. (CREATING, ACTIVE, DELETING, DELETED, FAILED, UPDATING) |
lifecycleStateDetails | string | Any additional details about the current state of the stream. |
messagesEndpoint | string | The endpoint to use when creating the StreamClient to consume or publish messages in the stream. If the associated stream pool is private, the endpoint is also private and can only be accessed from inside the stream pool's associated subnet. |
partitions | integer | The number of partitions in the stream. |
retentionInHours | integer | The retention period of the stream, in hours. This property is read-only. |
streamPoolId | string | The OCID of the stream pool that contains the stream. (example: ocid1.streampool.realm.region.zxcvbn432765) |
timeCreated | string (date-time) | The date and time the stream was created, expressed in in [RFC 3339](https:​//tools.ietf.org/rfc/rfc3339) timestamp format. Example: 2018-04-20T00:00:07.405Z |
Summary representation of a stream.
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the stream. (example: ocid1.stream.realm.region.mnopqr789) |
name | string | The name of the stream. Example: TelemetryEvents (example: TelemetryEvents) |
compartmentId | string | The OCID of the compartment that contains the stream. (example: ocid1.compinstance.realm.region.zxcvbn432765) |
definedTags | object | Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"Operations": {"CostCenter": "42"}} |
freeformTags | object | Free-form tags for this resource. Each tag is a simple key-value pair that is applied with no predefined name, type, or namespace. Exists for cross-compatibility only. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"} |
lifecycleState | string | The current state of the stream. (CREATING, ACTIVE, DELETING, DELETED, FAILED, UPDATING) |
messagesEndpoint | string | The endpoint to use when creating the StreamClient to consume or publish messages in the stream. If the associated stream pool is private, the endpoint is also private and can only be accessed from inside the stream pool's associated subnet. |
partitions | integer | The number of partitions in the stream. |
streamPoolId | string | The OCID of the stream pool that contains the stream. (example: ocid1.streampool.realm.region.zxcvbn432765) |
timeCreated | string (date-time) | The date and time the stream was created, expressed in [RFC 3339](https:​//tools.ietf.org/rfc/rfc3339) timestamp format. Example: 2018-04-20T00:00:07.405Z |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | streamId, region | opc-request-id | Gets detailed information about a stream, including the number of partitions. |
list | select | region | compartmentId, streamPoolId, id, name, limit, page, sortBy, sortOrder, lifecycleState, opc-request-id | Lists the streams in the given compartment id.<br />If the compartment id is specified, it will list streams in the compartment, regardless of their stream pool.<br />If the stream pool id is specified, the action will be scoped to that stream pool.<br />The compartment id and stream pool id cannot be specified at the same time.<br /> |
create | insert | region, name, partitions | opc-request-id | Starts the provisioning of a new stream.<br />The stream will be created in the given compartment id or stream pool id, depending on which parameter is specified.<br />Compartment id and stream pool id cannot be specified at the same time.<br />To track the progress of the provisioning, you can periodically call [GetStream](#/en/streaming/20180418/Stream/GetStream).<br />In the response, the lifecycleState parameter of the [Stream](#/en/streaming/20180418/Stream/) object tells you its current state.<br /> |
update | update | streamId, region | opc-request-id, if-match | Updates the stream. Only specified values will be updated.<br /> |
delete | delete | streamId, region | opc-request-id, if-match | Deletes a stream and its content. Stream contents are deleted immediately. The service retains records of the stream itself for 90 days after deletion.<br />The lifecycleState parameter of the Stream object changes to DELETING and the stream becomes inaccessible for read or write operations.<br />To verify that a stream has been deleted, make a [GetStream](#/en/streaming/20180418/Stream/GetStream) request. If the call returns the stream's<br />lifecycle state as DELETED, then the stream has been deleted. If the call returns a "404 Not Found" error, that means all records of the<br />stream have been deleted.<br /> |
change_compartment | exec | streamId, region, compartmentId | if-match, opc-request-id | Moves a resource into a different compartment.<br />When provided, If-Match is checked against ETag values of the resource.<br />The stream will also be moved into the default stream pool in the destination compartment.<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) |
streamId | string | The OCID of the stream. |
compartmentId | string | The OCID of the compartment. Is exclusive with the streamPoolId parameter. One of them is required. |
id | string | A filter to return only resources that match the given ID exactly. |
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. The value must be between 1 and 50. The default is 10. |
name | string | A filter to return only resources that match the given name exactly. |
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. |
page | string | The page at which to start retrieving results. |
sortBy | string | The field to sort by. You can provide no more than one sort order. By default, TIMECREATED sorts results in descending order and NAME sorts results in ascending order. |
sortOrder | string | The sort order to use, either 'asc' or 'desc'. |
streamPoolId | string | The OCID of the stream pool. Is exclusive with the compartmentId parameter. One of them is required. |
SELECT examples​
- get
- list
Gets detailed information about a stream, including the number of partitions.
SELECT
id,
name,
compartmentId,
definedTags,
freeformTags,
lifecycleState,
lifecycleStateDetails,
messagesEndpoint,
partitions,
retentionInHours,
streamPoolId,
timeCreated
FROM oci.streaming.streams
WHERE streamId = '{{ streamId }}' -- required
AND region = '{{ region }}' -- required
AND opc-request-id = '{{ opc-request-id }}'
;
Lists the streams in the given compartment id.<br />If the compartment id is specified, it will list streams in the compartment, regardless of their stream pool.<br />If the stream pool id is specified, the action will be scoped to that stream pool.<br />The compartment id and stream pool id cannot be specified at the same time.<br />
SELECT
id,
name,
compartmentId,
definedTags,
freeformTags,
lifecycleState,
messagesEndpoint,
partitions,
streamPoolId,
timeCreated
FROM oci.streaming.streams
WHERE region = '{{ region }}' -- required
AND compartmentId = '{{ compartmentId }}'
AND streamPoolId = '{{ streamPoolId }}'
AND id = '{{ id }}'
AND name = '{{ name }}'
AND limit = '{{ limit }}'
AND page = '{{ page }}'
AND sortBy = '{{ sortBy }}'
AND sortOrder = '{{ sortOrder }}'
AND lifecycleState = '{{ lifecycleState }}'
AND opc-request-id = '{{ opc-request-id }}'
;
INSERT examples​
- create
- Manifest
Starts the provisioning of a new stream.<br />The stream will be created in the given compartment id or stream pool id, depending on which parameter is specified.<br />Compartment id and stream pool id cannot be specified at the same time.<br />To track the progress of the provisioning, you can periodically call [GetStream](#/en/streaming/20180418/Stream/GetStream).<br />In the response, the lifecycleState parameter of the [Stream](#/en/streaming/20180418/Stream/) object tells you its current state.<br />
INSERT INTO oci.streaming.streams (
compartmentId,
definedTags,
freeformTags,
name,
partitions,
retentionInHours,
streamPoolId,
region,
opc-request-id
)
SELECT
'{{ compartmentId }}',
'{{ definedTags }}',
'{{ freeformTags }}',
'{{ name }}' /* required */,
{{ partitions }} /* required */,
{{ retentionInHours }},
'{{ streamPoolId }}',
'{{ region }}',
'{{ opc-request-id }}'
RETURNING
id,
name,
compartmentId,
definedTags,
freeformTags,
lifecycleState,
lifecycleStateDetails,
messagesEndpoint,
partitions,
retentionInHours,
streamPoolId,
timeCreated
;
# Description fields are for documentation purposes
- name: streams
props:
- name: region
value: "{{ region }}"
description: Required parameter for the streams resource.
- name: compartmentId
value: "{{ compartmentId }}"
description: |
The OCID of the compartment that contains the stream.
- name: definedTags
value: "{{ definedTags }}"
description: |
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm).
Example: `{"Operations": {"CostCenter": "42"}}`
- name: freeformTags
value: "{{ freeformTags }}"
description: |
Free-form tags for this resource. Each tag is a simple key-value pair that is applied with no predefined name, type, or namespace. Exists for cross-compatibility only.
For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm).
Example: `{"Department": "Finance"}`
- name: name
value: "{{ name }}"
description: |
The name of the stream. Avoid entering confidential information.
Example: `TelemetryEvents`
- name: partitions
value: {{ partitions }}
description: |
The number of partitions in the stream.
- name: retentionInHours
value: {{ retentionInHours }}
description: |
The retention period of the stream, in hours. Accepted values are between 24 and 168 (7 days).
If not specified, the stream will have a retention period of 24 hours.
- name: streamPoolId
value: "{{ streamPoolId }}"
description: |
The OCID of the stream pool that contains the stream.
- name: opc-request-id
value: "{{ opc-request-id }}"
description: The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
description: The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
UPDATE examples​
- update
Updates the stream. Only specified values will be updated.<br />
UPDATE oci.streaming.streams
SET
definedTags = '{{ definedTags }}',
freeformTags = '{{ freeformTags }}',
streamPoolId = '{{ streamPoolId }}'
WHERE
streamId = '{{ streamId }}' --required
AND region = '{{ region }}' --required
AND opc-request-id = '{{ opc-request-id}}'
AND if-match = '{{ if-match}}'
RETURNING
id,
name,
compartmentId,
definedTags,
freeformTags,
lifecycleState,
lifecycleStateDetails,
messagesEndpoint,
partitions,
retentionInHours,
streamPoolId,
timeCreated;
DELETE examples​
- delete
Deletes a stream and its content. Stream contents are deleted immediately. The service retains records of the stream itself for 90 days after deletion.<br />The lifecycleState parameter of the Stream object changes to DELETING and the stream becomes inaccessible for read or write operations.<br />To verify that a stream has been deleted, make a [GetStream](#/en/streaming/20180418/Stream/GetStream) request. If the call returns the stream's<br />lifecycle state as DELETED, then the stream has been deleted. If the call returns a "404 Not Found" error, that means all records of the<br />stream have been deleted.<br />
DELETE FROM oci.streaming.streams
WHERE streamId = '{{ streamId }}' --required
AND region = '{{ region }}' --required
AND opc-request-id = '{{ opc-request-id }}'
AND if-match = '{{ if-match }}'
;
Lifecycle Methods​
- change_compartment
Moves a resource into a different compartment.<br />When provided, If-Match is checked against ETag values of the resource.<br />The stream will also be moved into the default stream pool in the destination compartment.<br />
EXEC oci.streaming.streams.change_compartment
@streamId='{{ streamId }}' --required,
@region='{{ region }}' --required,
@if-match='{{ if-match }}',
@opc-request-id='{{ opc-request-id }}'
@@json=
'{
"compartmentId": "{{ compartmentId }}"
}'
;