Skip to content

Commit

Permalink
update the update.yaml files
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoweim committed Nov 7, 2024
1 parent db753bf commit c6fad4a
Show file tree
Hide file tree
Showing 6 changed files with 206 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ metadata:
finalizers:
- cnrm.cloud.google.com/finalizer
- cnrm.cloud.google.com/deletion-defender
generation: 1
generation: 2
labels:
cnrm-test: "true"
name: bigqueryroutine-${uniqueId}
namespace: ${uniqueId}
spec:
datasetRef:
name: bigquerydataset${uniqueId}
definitionBody: CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x
+ y);
definitionBody: CREATE FUNCTION Sub(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x
- y);
projectRef:
external: ${projectId}
resourceID: bigqueryroutine${uniqueId}
Expand All @@ -30,4 +30,4 @@ status:
type: Ready
creationTime: "1970-01-01T00:00:00Z"
lastModifiedTime: "1970-01-01T00:00:00Z"
observedGeneration: 1
observedGeneration: 2
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,79 @@ X-Xss-Protection: 0

---

PUT https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/routines/bigqueryroutine${uniqueId}?alt=json
Content-Type: application/json
User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager

{
"definitionBody": "CREATE FUNCTION Sub(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x - y);",
"language": "SQL",
"routineReference": {
"datasetId": "bigquerydataset${uniqueId}",
"projectId": "${projectId}",
"routineId": "bigqueryroutine${uniqueId}"
},
"routineType": "PROCEDURE"
}

200 OK
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
"creationTime": "123456789",
"definitionBody": "CREATE FUNCTION Sub(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x - y);",
"etag": "abcdef0123A=",
"language": "SQL",
"lastModifiedTime": "123456789",
"routineReference": {
"datasetId": "bigquerydataset${uniqueId}",
"projectId": "${projectId}",
"routineId": "bigqueryroutine${uniqueId}"
},
"routineType": "PROCEDURE"
}

---

GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/routines/bigqueryroutine${uniqueId}?alt=json
Content-Type: application/json
User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager

200 OK
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
"creationTime": "123456789",
"definitionBody": "CREATE FUNCTION Sub(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x - y);",
"etag": "abcdef0123A=",
"language": "SQL",
"lastModifiedTime": "123456789",
"routineReference": {
"datasetId": "bigquerydataset${uniqueId}",
"projectId": "${projectId}",
"routineId": "bigqueryroutine${uniqueId}"
},
"routineType": "PROCEDURE"
}

---

DELETE https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/routines/bigqueryroutine${uniqueId}?alt=json
Content-Type: application/json
User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ metadata:
spec:
datasetRef:
name: bigquerydataset${uniqueId}
definitionBody: CREATE FUNCTION Add(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x
+ y);
definitionBody: CREATE FUNCTION Sub(x FLOAT64, y FLOAT64) RETURNS FLOAT64 AS (x
- y);
projectRef:
external: ${projectId}
resourceID: bigqueryroutine${uniqueId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
finalizers:
- cnrm.cloud.google.com/finalizer
- cnrm.cloud.google.com/deletion-defender
generation: 1
generation: 2
labels:
cnrm-test: "true"
name: bigqueryroutine-${uniqueId}
Expand All @@ -16,17 +16,17 @@ spec:
arguments:
- argumentKind: FIXED_TYPE
dataType: '{"typeKind":"STRING"}'
name: ssn
name: xyz
datasetRef:
name: bigquerydataset${uniqueId}
definitionBody: SAFE.REGEXP_REPLACE(ssn, '[0-9]', 'X')
description: fully configured big query routine
determinismLevel: DETERMINISM_LEVEL_UNSPECIFIED
definitionBody: SAFE.REGEXP_REPLACE(xyz, '[0-9]', 'X')
description: fully configured big query routine updated
determinismLevel: NOT_DETERMINISTIC
language: SQL
projectRef:
external: ${projectId}
resourceID: bigqueryroutine${uniqueId}
returnType: '{"typeKind":"STRING"}'
returnType: '{"typeKind":"INT64"}'
routineType: SCALAR_FUNCTION
status:
conditions:
Expand All @@ -37,4 +37,4 @@ status:
type: Ready
creationTime: "1970-01-01T00:00:00Z"
lastModifiedTime: "1970-01-01T00:00:00Z"
observedGeneration: 1
observedGeneration: 2
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,121 @@ X-Xss-Protection: 0

---

PUT https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/routines/bigqueryroutine${uniqueId}?alt=json
Content-Type: application/json
User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager

{
"arguments": [
{
"argumentKind": "FIXED_TYPE",
"dataType": {
"typeKind": "STRING"
},
"name": "xyz"
}
],
"definitionBody": "SAFE.REGEXP_REPLACE(xyz, '[0-9]', 'X')",
"description": "fully configured big query routine updated",
"determinismLevel": "NOT_DETERMINISTIC",
"language": "SQL",
"returnType": {
"typeKind": "INT64"
},
"routineReference": {
"datasetId": "bigquerydataset${uniqueId}",
"projectId": "${projectId}",
"routineId": "bigqueryroutine${uniqueId}"
},
"routineType": "SCALAR_FUNCTION"
}

200 OK
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
"arguments": [
{
"argumentKind": "FIXED_TYPE",
"dataType": {
"typeKind": "STRING"
},
"name": "xyz"
}
],
"creationTime": "123456789",
"definitionBody": "SAFE.REGEXP_REPLACE(xyz, '[0-9]', 'X')",
"description": "fully configured big query routine updated",
"determinismLevel": "NOT_DETERMINISTIC",
"etag": "abcdef0123A=",
"language": "SQL",
"lastModifiedTime": "123456789",
"returnType": {
"typeKind": "INT64"
},
"routineReference": {
"datasetId": "bigquerydataset${uniqueId}",
"projectId": "${projectId}",
"routineId": "bigqueryroutine${uniqueId}"
},
"routineType": "SCALAR_FUNCTION"
}

---

GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/routines/bigqueryroutine${uniqueId}?alt=json
Content-Type: application/json
User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager

200 OK
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
"arguments": [
{
"argumentKind": "FIXED_TYPE",
"dataType": {
"typeKind": "STRING"
},
"name": "xyz"
}
],
"creationTime": "123456789",
"definitionBody": "SAFE.REGEXP_REPLACE(xyz, '[0-9]', 'X')",
"description": "fully configured big query routine updated",
"determinismLevel": "NOT_DETERMINISTIC",
"etag": "abcdef0123A=",
"language": "SQL",
"lastModifiedTime": "123456789",
"returnType": {
"typeKind": "INT64"
},
"routineReference": {
"datasetId": "bigquerydataset${uniqueId}",
"projectId": "${projectId}",
"routineId": "bigqueryroutine${uniqueId}"
},
"routineType": "SCALAR_FUNCTION"
}

---

DELETE https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/routines/bigqueryroutine${uniqueId}?alt=json
Content-Type: application/json
User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ metadata:
name: bigqueryroutine-${uniqueId}
spec:
arguments:
- name: "ssn"
- name: "xyz"
dataType: "{\"typeKind\":\"STRING\"}"
argumentKind: "FIXED_TYPE"
datasetRef:
name: bigquerydataset${uniqueId}
definitionBody: SAFE.REGEXP_REPLACE(ssn, '[0-9]', 'X')
description: "fully configured big query routine"
determinismLevel: DETERMINISM_LEVEL_UNSPECIFIED
definitionBody: SAFE.REGEXP_REPLACE(xyz, '[0-9]', 'X')
description: "fully configured big query routine updated"
determinismLevel: NOT_DETERMINISTIC
language: SQL
projectRef:
external: ${projectId}
resourceID: bigqueryroutine${uniqueId}
returnType: "{\"typeKind\":\"STRING\"}"
returnType: "{\"typeKind\":\"INT64\"}"
routineType: SCALAR_FUNCTION

0 comments on commit c6fad4a

Please sign in to comment.