hooks
Creates, updates, deletes, gets or lists a hooks
resource.
Overview
Name | hooks |
Type | Resource |
Id | google.securesourcemanager.hooks |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. A unique identifier for a Hook. The name should be of the format: projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id} |
createTime | string (google-datetime) | Output only. Create timestamp. |
disabled | boolean | Optional. Determines if the hook disabled or not. Set to true to stop sending traffic. |
events | array | Optional. The events that trigger hook on. |
pushOption | object | Optional. The trigger option for push events. (id: PushOption) |
sensitiveQueryString | string | Optional. The sensitive query string to be appended to the target URI. |
targetUri | string | Required. The target URI to which the payloads will be delivered. |
uid | string | Output only. Unique identifier of the hook. |
updateTime | string (google-datetime) | Output only. Update timestamp. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. A unique identifier for a Hook. The name should be of the format: projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id} |
createTime | string (google-datetime) | Output only. Create timestamp. |
disabled | boolean | Optional. Determines if the hook disabled or not. Set to true to stop sending traffic. |
events | array | Optional. The events that trigger hook on. |
pushOption | object | Optional. The trigger option for push events. (id: PushOption) |
sensitiveQueryString | string | Optional. The sensitive query string to be appended to the target URI. |
targetUri | string | Required. The target URI to which the payloads will be delivered. |
uid | string | Output only. Unique identifier of the hook. |
updateTime | string (google-datetime) | Output only. Update timestamp. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , repositoriesId , hooksId | Gets metadata of a hook. | |
list | select | projectsId , locationsId , repositoriesId | pageSize , pageToken | Lists hooks in a given repository. |
create | insert | projectsId , locationsId , repositoriesId | hookId | Creates a new hook in a given repository. |
patch | update | projectsId , locationsId , repositoriesId , hooksId | updateMask | Updates the metadata of a hook. |
delete | delete | projectsId , locationsId , repositoriesId , hooksId | Deletes a Hook. |
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 |
---|---|---|
hooksId | string | |
locationsId | string | |
projectsId | string | |
repositoriesId | string | |
hookId | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
Gets metadata of a hook.
SELECT
name,
createTime,
disabled,
events,
pushOption,
sensitiveQueryString,
targetUri,
uid,
updateTime
FROM google.securesourcemanager.hooks
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND repositoriesId = '{{ repositoriesId }}' -- required
AND hooksId = '{{ hooksId }}' -- required;
Lists hooks in a given repository.
SELECT
name,
createTime,
disabled,
events,
pushOption,
sensitiveQueryString,
targetUri,
uid,
updateTime
FROM google.securesourcemanager.hooks
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND repositoriesId = '{{ repositoriesId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- Manifest
Creates a new hook in a given repository.
INSERT INTO google.securesourcemanager.hooks (
data__name,
data__targetUri,
data__disabled,
data__events,
data__pushOption,
data__sensitiveQueryString,
projectsId,
locationsId,
repositoriesId,
hookId
)
SELECT
'{{ name }}',
'{{ targetUri }}',
{{ disabled }},
'{{ events }}',
'{{ pushOption }}',
'{{ sensitiveQueryString }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ repositoriesId }}',
'{{ hookId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: hooks
props:
- name: projectsId
value: string
description: Required parameter for the hooks resource.
- name: locationsId
value: string
description: Required parameter for the hooks resource.
- name: repositoriesId
value: string
description: Required parameter for the hooks resource.
- name: name
value: string
description: >
Identifier. A unique identifier for a Hook. The name should be of the format: `projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`
- name: targetUri
value: string
description: >
Required. The target URI to which the payloads will be delivered.
- name: disabled
value: boolean
description: >
Optional. Determines if the hook disabled or not. Set to true to stop sending traffic.
- name: events
value: array
description: >
Optional. The events that trigger hook on.
- name: pushOption
value: object
description: >
Optional. The trigger option for push events.
- name: sensitiveQueryString
value: string
description: >
Optional. The sensitive query string to be appended to the target URI.
- name: hookId
value: string
UPDATE
examples
- patch
Updates the metadata of a hook.
UPDATE google.securesourcemanager.hooks
SET
data__name = '{{ name }}',
data__targetUri = '{{ targetUri }}',
data__disabled = {{ disabled }},
data__events = '{{ events }}',
data__pushOption = '{{ pushOption }}',
data__sensitiveQueryString = '{{ sensitiveQueryString }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND repositoriesId = '{{ repositoriesId }}' --required
AND hooksId = '{{ hooksId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;
DELETE
examples
- delete
Deletes a Hook.
DELETE FROM google.securesourcemanager.hooks
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND repositoriesId = '{{ repositoriesId }}' --required
AND hooksId = '{{ hooksId }}' --required;