rulesets
Creates, updates, deletes, gets or lists a rulesets
resource.
Overview
Name | rulesets |
Type | Resource |
Id | firebase.rules.rulesets |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Name of the Ruleset . The ruleset_id is auto generated by the service. Format: projects/{project_id}/rulesets/{ruleset_id} |
attachmentPoint | string | Immutable. Intended resource to which this Ruleset should be released. May be left blank to signify the resource associated with the default release. Expected format: firestore.googleapis.com/projects//databases/ |
createTime | string (google-datetime) | Output only. Time the Ruleset was created. |
metadata | object | Output only. The metadata for this ruleset. (id: Metadata) |
source | object | Required. Source for the Ruleset . (id: Source) |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Name of the Ruleset . The ruleset_id is auto generated by the service. Format: projects/{project_id}/rulesets/{ruleset_id} |
attachmentPoint | string | Immutable. Intended resource to which this Ruleset should be released. May be left blank to signify the resource associated with the default release. Expected format: firestore.googleapis.com/projects//databases/ |
createTime | string (google-datetime) | Output only. Time the Ruleset was created. |
metadata | object | Output only. The metadata for this ruleset. (id: Metadata) |
source | object | Required. Source for the Ruleset . (id: Source) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , rulesetsId | Get a Ruleset by name including the full Source contents. | |
list | select | projectsId | filter , pageSize , pageToken | List Ruleset metadata only and optionally filter the results by Ruleset name. The full Source contents of a Ruleset may be retrieved with GetRuleset. |
create | insert | projectsId | Create a Ruleset from Source . The Ruleset is given a unique generated name which is returned to the caller. Source containing syntactic or semantics errors will result in an error response indicating the first error encountered. For a detailed view of Source issues, use TestRuleset. | |
delete | delete | projectsId , rulesetsId | Delete a Ruleset by resource name. If the Ruleset is referenced by a Release the operation will fail. |
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 |
---|---|---|
projectsId | string | |
rulesetsId | string | |
filter | string | |
pageSize | integer (int32) | |
pageToken | string |
SELECT
examples
- get
- list
Get a Ruleset
by name including the full Source
contents.
SELECT
name,
attachmentPoint,
createTime,
metadata,
source
FROM firebase.rules.rulesets
WHERE projectsId = '{{ projectsId }}' -- required
AND rulesetsId = '{{ rulesetsId }}' -- required;
List Ruleset
metadata only and optionally filter the results by Ruleset
name. The full Source
contents of a Ruleset
may be retrieved with GetRuleset.
SELECT
name,
attachmentPoint,
createTime,
metadata,
source
FROM firebase.rules.rulesets
WHERE projectsId = '{{ projectsId }}' -- required
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- Manifest
Create a Ruleset
from Source
. The Ruleset
is given a unique generated name which is returned to the caller. Source
containing syntactic or semantics errors will result in an error response indicating the first error encountered. For a detailed view of Source
issues, use TestRuleset.
INSERT INTO firebase.rules.rulesets (
data__source,
data__attachmentPoint,
projectsId
)
SELECT
'{{ source }}',
'{{ attachmentPoint }}',
'{{ projectsId }}'
RETURNING
name,
attachmentPoint,
createTime,
metadata,
source
;
# Description fields are for documentation purposes
- name: rulesets
props:
- name: projectsId
value: string
description: Required parameter for the rulesets resource.
- name: source
value: object
description: >
Required. `Source` for the `Ruleset`.
- name: attachmentPoint
value: string
description: >
Immutable. Intended resource to which this Ruleset should be released. May be left blank to signify the resource associated with the default release. Expected format: firestore.googleapis.com/projects//databases/
DELETE
examples
- delete
Delete a Ruleset
by resource name. If the Ruleset
is referenced by a Release
the operation will fail.
DELETE FROM firebase.rules.rulesets
WHERE projectsId = '{{ projectsId }}' --required
AND rulesetsId = '{{ rulesetsId }}' --required;