From a1833e86cb929603d0a846c1e55a9385184fb747 Mon Sep 17 00:00:00 2001 From: justinsb Date: Sat, 17 Aug 2024 11:00:59 -0400 Subject: [PATCH 1/3] tests: capture golden output for PubSub --- .../v1beta1/containercluster/_http.log | 78 - ...reamingdataflowflextemplatejob.golden.yaml | 45 + .../_http.log | 1474 +++++++++++++++ ...object_basicpubsubsubscription.golden.yaml | 35 + .../basicpubsubsubscription/_http.log | 371 ++++ ...ect_bigquerypubsubsubscription.golden.yaml | 34 + .../bigquerypubsubsubscription/_http.log | 1668 +++++++++++++++++ .../_generated_object_pubsubtopic.golden.yaml | 24 - .../pubsub/v1beta1/pubsubtopic/_http.log | 52 - .../v1beta1/secretmanagersecret/_http.log | 78 - .../storagenotificationbase/_http.log | 78 - .../storagenotificationfull/_http.log | 78 - ...erated_object_externalwithname.golden.yaml | 31 + .../externalref/externalwithname/_http.log | 355 ++++ .../serviceaccountref/_http.log | 78 - .../sqlinstanceref/_http.log | 78 - 16 files changed, 4013 insertions(+), 544 deletions(-) create mode 100644 pkg/test/resourcefixture/testdata/basic/dataflow/v1beta1/dataflowflextemplatejob/streamingdataflowflextemplatejob/_generated_object_streamingdataflowflextemplatejob.golden.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/dataflow/v1beta1/dataflowflextemplatejob/streamingdataflowflextemplatejob/_http.log create mode 100644 pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubsubscription/basicpubsubsubscription/_generated_object_basicpubsubsubscription.golden.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubsubscription/basicpubsubsubscription/_http.log create mode 100644 pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubsubscription/bigquerypubsubsubscription/_generated_object_bigquerypubsubsubscription.golden.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubsubscription/bigquerypubsubsubscription/_http.log create mode 100644 pkg/test/resourcefixture/testdata/externalref/externalwithname/_generated_object_externalwithname.golden.yaml create mode 100644 pkg/test/resourcefixture/testdata/externalref/externalwithname/_http.log diff --git a/pkg/test/resourcefixture/testdata/basic/container/v1beta1/containercluster/_http.log b/pkg/test/resourcefixture/testdata/basic/container/v1beta1/containercluster/_http.log index a146723210..388d363d94 100644 --- a/pkg/test/resourcefixture/testdata/basic/container/v1beta1/containercluster/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/container/v1beta1/containercluster/_http.log @@ -330,32 +330,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" } @@ -381,32 +355,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" } @@ -1463,32 +1411,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" } diff --git a/pkg/test/resourcefixture/testdata/basic/dataflow/v1beta1/dataflowflextemplatejob/streamingdataflowflextemplatejob/_generated_object_streamingdataflowflextemplatejob.golden.yaml b/pkg/test/resourcefixture/testdata/basic/dataflow/v1beta1/dataflowflextemplatejob/streamingdataflowflextemplatejob/_generated_object_streamingdataflowflextemplatejob.golden.yaml new file mode 100644 index 0000000000..367c498d7c --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/dataflow/v1beta1/dataflowflextemplatejob/streamingdataflowflextemplatejob/_generated_object_streamingdataflowflextemplatejob.golden.yaml @@ -0,0 +1,45 @@ +apiVersion: dataflow.cnrm.cloud.google.com/v1beta1 +kind: DataflowFlexTemplateJob +metadata: + annotations: + cnrm.cloud.google.com/management-conflict-prevention-policy: none + cnrm.cloud.google.com/mutable-but-unreadable-fields: '{"spec":{"containerSpecGcsPath":"gs://dataflow-templates/2020-08-31-00_RC00/flex/PubSub_Avro_to_BigQuery","parameters":{"createDisposition":"CREATE_NEVER","inputSubscription":"projects/${projectId}/subscriptions/pubsubsubscription-${uniqueId}","outputTableSpec":"${projectId}:bigquerydataset${uniqueId}.bigquerytable${uniqueId}","outputTopic":"projects/${projectId}/topics/pubsubtopic1-${uniqueId}","schemaPath":"gs://config-connector-samples/dataflowflextemplate/numbers.avsc"}}}' + cnrm.cloud.google.com/on-delete: cancel + cnrm.cloud.google.com/project-id: ${projectId} + cnrm.cloud.google.com/state-into-spec: merge + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 2 + labels: + cnrm-test: "true" + label-one: value-one + name: dataflowflextemplatejob-${uniqueId} + namespace: ${uniqueId} +spec: + additionalExperiments: + - disable_runner_v2_reason=java_job_google_template + - enable_always_on_exception_sampling + containerSpecGcsPath: gs://dataflow-templates/2020-08-31-00_RC00/flex/PubSub_Avro_to_BigQuery + parameters: + createDisposition: CREATE_NEVER + inputSubscription: projects/${projectId}/subscriptions/pubsubsubscription-${uniqueId} + outputTableSpec: ${projectId}:bigquerydataset${uniqueId}.bigquerytable${uniqueId} + outputTopic: projects/${projectId}/topics/pubsubtopic1-${uniqueId} + schemaPath: gs://config-connector-samples/dataflowflextemplate/numbers.avsc + region: us-central1 + serviceAccountEmailRef: + external: ${projectNumber}-compute@developer.gserviceaccount.com + stagingLocation: gs://dataflow-staging-us-central1-${projectNumber}/staging + tempLocation: gs://dataflow-staging-us-central1-${projectNumber}/tmp +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + jobId: ${jobID} + observedGeneration: 2 + state: JOB_STATE_RUNNING + type: JOB_TYPE_BATCH diff --git a/pkg/test/resourcefixture/testdata/basic/dataflow/v1beta1/dataflowflextemplatejob/streamingdataflowflextemplatejob/_http.log b/pkg/test/resourcefixture/testdata/basic/dataflow/v1beta1/dataflowflextemplatejob/streamingdataflowflextemplatejob/_http.log new file mode 100644 index 0000000000..48fc0e3dfc --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/dataflow/v1beta1/dataflowflextemplatejob/streamingdataflowflextemplatejob/_http.log @@ -0,0 +1,1474 @@ +GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?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 + +404 Not Found +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 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "Not found: Dataset ${projectId}:bigquerydataset${uniqueId}", + "reason": "notFound" + } + ], + "message": "Not found: Dataset ${projectId}:bigquerydataset${uniqueId}", + "status": "NOT_FOUND" + } +} + +--- + +POST https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets?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 + +{ + "datasetReference": { + "datasetId": "bigquerydataset${uniqueId}" + }, + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "location": "US" +} + +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 + +{ + "access": [ + { + "role": "WRITER", + "specialGroup": "projectWriters" + }, + { + "role": "OWNER", + "specialGroup": "projectOwners" + }, + { + "role": "OWNER", + "userByEmail": "user@google.com" + }, + { + "role": "READER", + "specialGroup": "projectReaders" + } + ], + "creationTime": "123456789", + "datasetReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}" + }, + "etag": "abcdef0123A=", + "id": "000000000000000000000", + "kind": "bigquery#dataset", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lastModifiedTime": "123456789", + "location": "US", + "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}", + "type": "DEFAULT" +} + +--- + +GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?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 + +{ + "access": [ + { + "role": "WRITER", + "specialGroup": "projectWriters" + }, + { + "role": "OWNER", + "specialGroup": "projectOwners" + }, + { + "role": "OWNER", + "userByEmail": "user@google.com" + }, + { + "role": "READER", + "specialGroup": "projectReaders" + } + ], + "creationTime": "123456789", + "datasetReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}" + }, + "etag": "abcdef0123A=", + "id": "000000000000000000000", + "kind": "bigquery#dataset", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lastModifiedTime": "123456789", + "location": "US", + "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}", + "type": "DEFAULT" +} + +--- + +GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/tables/bigquerytable${uniqueId}?alt=json&prettyPrint=false +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +404 Not Found +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 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "Not found: Table ${projectId}:bigquerydataset${uniqueId}.bigquerytable${uniqueId}", + "reason": "notFound" + } + ], + "message": "Not found: Table ${projectId}:bigquerydataset${uniqueId}.bigquerytable${uniqueId}", + "status": "NOT_FOUND" + } +} + +--- + +POST https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/tables?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "tableReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}", + "tableId": "bigquerytable${uniqueId}" + } +} + +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", + "etag": "abcdef0123A=", + "id": "000000000000000000000", + "kind": "bigquery#table", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lastModifiedTime": "123456789", + "location": "US", + "numActiveLogicalBytes": "0", + "numBytes": "0", + "numLongTermBytes": "0", + "numLongTermLogicalBytes": "0", + "numRows": "0", + "numTotalLogicalBytes": "0", + "schema": {}, + "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}/tables/bigquerytable${uniqueId}", + "tableReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}", + "tableId": "bigquerytable${uniqueId}" + }, + "type": "TABLE" +} + +--- + +GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/tables/bigquerytable${uniqueId}?alt=json&prettyPrint=false +User-Agent: google-api-go-client/0.5 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", + "etag": "abcdef0123A=", + "id": "000000000000000000000", + "kind": "bigquery#table", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lastModifiedTime": "123456789", + "location": "US", + "numActiveLogicalBytes": "0", + "numBytes": "0", + "numLongTermBytes": "0", + "numLongTermLogicalBytes": "0", + "numRows": "0", + "numTotalLogicalBytes": "0", + "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}/tables/bigquerytable${uniqueId}", + "tableReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}", + "tableId": "bigquerytable${uniqueId}" + }, + "type": "TABLE" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic0-${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 + +404 Not Found +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 + +{ + "error": { + "code": 404, + "message": "Resource not found (resource=pubsubtopic0-${uniqueId}).", + "status": "NOT_FOUND" + } +} + +--- + +PUT https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic0-${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 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + } +} + +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 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/topics/pubsubtopic0-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic0-${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 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/topics/pubsubtopic0-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic1-${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 + +404 Not Found +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 + +{ + "error": { + "code": 404, + "message": "Resource not found (resource=pubsubtopic1-${uniqueId}).", + "status": "NOT_FOUND" + } +} + +--- + +PUT https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic1-${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 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + } +} + +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 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/topics/pubsubtopic1-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic1-${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 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/topics/pubsubtopic1-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +404 Not Found +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 + +{ + "error": { + "code": 404, + "message": "Resource not found (resource=pubsubsubscription-${uniqueId}).", + "status": "NOT_FOUND" + } +} + +--- + +PUT https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +{ + "deadLetterPolicy": null, + "expirationPolicy": null, + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "604800s", + "topic": "projects/${projectId}/topics/pubsubtopic0-${uniqueId}" +} + +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 + +{ + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "604800s", + "name": "projects/${projectId}/subscriptions/pubsubsubscription-${uniqueId}", + "pushConfig": {}, + "state": "ACTIVE", + "topic": "projects/${projectId}/topics/pubsubtopic0-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +404 Not Found +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 + +{ + "error": { + "code": 404, + "message": "Resource not found (resource=pubsubsubscription-${uniqueId}).", + "status": "NOT_FOUND" + } +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +{ + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "604800s", + "name": "projects/${projectId}/subscriptions/pubsubsubscription-${uniqueId}", + "pushConfig": {}, + "state": "ACTIVE", + "topic": "projects/${projectId}/topics/pubsubtopic0-${uniqueId}" +} + +--- + +POST https://dataflow.googleapis.com/v1b3/projects/${projectId}/locations/us-central1/flexTemplates:launch?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "launchParameter": { + "containerSpecGcsPath": "gs://dataflow-templates/2020-08-31-00_RC00/flex/PubSub_Avro_to_BigQuery", + "environment": {}, + "jobName": "dataflowflextemplatejob-${uniqueId}", + "parameters": { + "createDisposition": "CREATE_NEVER", + "inputSubscription": "projects/${projectId}/subscriptions/pubsubsubscription-${uniqueId}", + "outputTableSpec": "${projectId}:bigquerydataset${uniqueId}.bigquerytable${uniqueId}", + "outputTopic": "projects/${projectId}/topics/pubsubtopic1-${uniqueId}", + "schemaPath": "gs://config-connector-samples/dataflowflextemplate/numbers.avsc" + } + } +} + +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 + +{ + "job": { + "createTime": "2024-04-01T12:34:56.123456Z", + "currentStateTime": "1970-01-01T00:00:00Z", + "id": "${jobID}", + "location": "us-central1", + "name": "dataflowflextemplatejob-${uniqueId}", + "projectId": "${projectId}", + "startTime": "2024-04-01T12:34:56.123456Z" + } +} + +--- + +GET https://dataflow.googleapis.com/v1b3/projects/${projectId}/locations/us-central1/jobs/${jobID}?alt=json&prettyPrint=false&view=JOB_VIEW_ALL +User-Agent: google-api-go-client/0.5 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 + +{ + "createTime": "2024-04-01T12:34:56.123456Z", + "currentState": "JOB_STATE_QUEUED", + "currentStateTime": "2024-04-01T12:34:56.123456Z", + "environment": { + "dataset": "bigquery.googleapis.com/cloud_dataflow" + }, + "id": "000000000000000000000", + "labels": { + "goog-dataflow-provided-template-name": "file_format_conversion", + "goog-dataflow-provided-template-type": "flex" + }, + "location": "us-central1", + "name": "dataflowflextemplatejob-${uniqueId}", + "pipelineDescription": { + "removed": "simplicity" + }, + "projectId": "${projectId}", + "startTime": "2024-04-01T12:34:56.123456Z" +} + +--- + +GET https://dataflow.googleapis.com/v1b3/projects/${projectId}/locations/us-central1/jobs/${jobID}?alt=json&prettyPrint=false&view=JOB_VIEW_ALL +User-Agent: google-api-go-client/0.5 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 + +{ + "createTime": "2024-04-01T12:34:56.123456Z", + "currentState": "JOB_STATE_RUNNING", + "currentStateTime": "2024-04-01T12:34:56.123456Z", + "environment": { + "dataset": "bigquery.googleapis.com/cloud_dataflow", + "experiments": [ + "auto_google_template_runner_v2", + "auto_high_core_runner_v2", + "auto_runner_v2_min_sdk=2.54.0", + "configure_shuffle_service_addresses_in_control_plane", + "delayed_launch", + "disable_baggins_exp", + "disable_primeflex", + "disable_runner_v2_reason=java_job_google_template", + "ek_regions=", + "enable_always_on_exception_sampling", + "enable_always_on_exception_sampling", + "enable_async_job_creation", + "enable_billing_v_1_5", + "enable_cloud_permissions_checking", + "enable_cmek_org_policy_check", + "enable_compute_default_service_account_org_policy", + "enable_data_sampling_telemetry", + "enable_dataprep_new_billing", + "enable_fnapi_multimap_side_input_bulk_read", + "enable_memory_sampler", + "enable_oom_sampler", + "enable_recommendations", + "enable_remote_image_ping", + "enable_secure_boot", + "enable_throttled_based_rescaling", + "enable_worker_cloud_monitoring_exporter", + "enable_worker_disk_cloud_monitoring", + "enable_worker_memory_cloud_monitoring", + "enable_zonal_outage_aware_routing", + "limit_preemptible_worker_pct", + "limit_resizing_by_cpu_util", + "min_sdk_version_to_reject_worker_in_different_region_than_service=2.44.0", + "override_controller_service_account", + "primeflex_slow_start_pct=5", + "primeflex_slow_start_seconds=3600", + "regional_physical_zone_separation_enabled", + "shuffle_mode=auto", + "shuffle_service_address_type=DIRECTPATH_WITH_CFE_FALLBACK", + "sideinput_io_metrics", + "use_dataflow_service_account_in_igm", + "use_e2_for_default_machine_type_worker_regions=africa-south1,europe-north2,europe-southwest1,europe-west10,europe-west12,europe-west8,europe-west9,me-central1,me-central2,me-west1,northamerica-south1,southamerica-west1,us-east10,us-east5,us-east7,us-south1,us-west8", + "use_job_admission_controller", + "use_multi_hop_delegation", + "use_templates_regional_bucket", + "use_worker_zone_chooser_by_default" + ], + "sdkPipelineOptions": { + "display_data": [], + "options": { + "apiRootUrl": "https://dataflow.googleapis.com/", + "appName": "FileFormatConversion", + "autoscalingAlgorithm": null, + "containsHeaders": false, + "credentialFactoryClass": "org.apache.beam.sdk.extensions.gcp.auth.GcpCredentialFactory", + "csvFileEncoding": "UTF-8", + "csvFormat": "Default", + "dataflowEndpoint": "", + "dataflowKmsKey": null, + "dataflowServiceOptions": null, + "dataflowWorkerJar": null, + "defaultEnvironmentConfig": null, + "defaultEnvironmentType": null, + "delimiter": ",", + "diskSizeGb": 0, + "enableCloudDebugger": false, + "enableStreamingEngine": false, + "environmentOptions": null, + "experiments": [ + "disable_runner_v2_reason=java_job_google_template", + "enable_always_on_exception_sampling" + ], + "filesToStage": [ + "/template/file-format-conversion/file-format-conversion.jar" + ], + "gcpTempLocation": "gs://dataflow-staging-us-central1-${projectNumber}/tmp", + "gcsPerformanceMetrics": false, + "gcsUploadBufferSizeBytes": null, + "googleApiTrace": null, + "hotKeyLoggingEnabled": false, + "inputFileFormat": "csv", + "inputFileSpec": "gs://config-connector-samples/dataflowflextemplate/numbertest.csv", + "jobName": "dataflowflextemplatejob-${uniqueId}", + "labels": { + "goog-dataflow-provided-template-name": "file_format_conversion", + "goog-dataflow-provided-template-type": "flex" + }, + "logDetailedCsvConversionErrors": false, + "maxNumWorkers": 0, + "network": null, + "numShards": 0, + "numWorkers": 0, + "numberOfWorkerHarnessThreads": 0, + "optionsId": 0, + "outputBucket": "gs://storagebucket-${uniqueId}", + "outputFileFormat": "avro", + "outputFilePrefix": "output", + "overrideWindmillBinary": null, + "pathValidatorClass": "org.apache.beam.sdk.extensions.gcp.storage.GcsPathValidator", + "pipelineUrl": "gs://dataflow-staging-us-central1-${projectNumber}/staging/pipeline-ehKedGonx8czD0ig9N0xE85y-KvEho1OrQ2jYCtevqg.pb", + "project": "${projectId}", + "recordJfrOnGcThrashing": false, + "region": "us-central1", + "resourceHints": [], + "runner": "org.apache.beam.runners.dataflow.DataflowRunner", + "saveProfilesToGcs": null, + "schema": "gs://config-connector-samples/dataflowflextemplate/numbers.avsc", + "sdkContainerImage": null, + "sdkHarnessContainerImageOverrides": null, + "serviceAccount": "${projectNumber}-compute@developer.gserviceaccount.com", + "stableUniqueNames": "WARNING", + "stagerClass": "org.apache.beam.runners.dataflow.util.GcsStager", + "stagingLocation": "gs://dataflow-staging-us-central1-${projectNumber}/staging", + "streaming": false, + "subnetwork": null, + "tempLocation": "gs://dataflow-staging-us-central1-${projectNumber}/tmp", + "templateLocation": "gs://dataflow-staging-us-central1-${projectNumber}/staging/template_launches/${jobID}/job_object", + "userAgent": "Apache_Beam_SDK_for_Java/2.41.0(JRE_11_environment)", + "workerDiskType": null, + "workerHarnessContainerImage": null, + "workerMachineType": null, + "workerRegion": null, + "zone": null + } + }, + "serviceAccountEmail": "${projectNumber}-compute@developer.gserviceaccount.com", + "shuffleMode": "SERVICE_BASED", + "tempStoragePrefix": "storage.googleapis.com/dataflow-staging-us-central1-${projectNumber}/tmp", + "userAgent": { + "removed": "simplicity" + }, + "version": { + "removed": "simplicity" + }, + "workerPools": [] + }, + "id": "000000000000000000000", + "jobMetadata": { + "removed": "simplicity" + }, + "labels": { + "goog-dataflow-provided-template-name": "file_format_conversion", + "goog-dataflow-provided-template-type": "flex" + }, + "location": "us-central1", + "name": "dataflowflextemplatejob-${uniqueId}", + "pipelineDescription": { + "removed": "simplicity" + }, + "projectId": "${projectId}", + "stageStates": [], + "startTime": "2024-04-01T12:34:56.123456Z", + "steps": [], + "type": "JOB_TYPE_BATCH" +} + +--- + +PUT https://dataflow.googleapis.com/v1b3/projects/${projectId}/locations/us-central1/jobs/${jobID}?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "requestedState": "JOB_STATE_CANCELLED" +} + +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 + +{ + "type": "JOB_TYPE_BATCH" +} + +--- + +GET https://dataflow.googleapis.com/v1b3/projects/${projectId}/locations/us-central1/jobs/${jobID}?alt=json&prettyPrint=false&view=JOB_VIEW_ALL +User-Agent: google-api-go-client/0.5 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 + +{ + "createTime": "2024-04-01T12:34:56.123456Z", + "currentState": "JOB_STATE_CANCELLING", + "currentStateTime": "2024-04-01T12:34:56.123456Z", + "environment": { + "dataset": "bigquery.googleapis.com/cloud_dataflow", + "experiments": [ + "auto_google_template_runner_v2", + "auto_high_core_runner_v2", + "auto_runner_v2_min_sdk=2.54.0", + "configure_shuffle_service_addresses_in_control_plane", + "delayed_launch", + "disable_baggins_exp", + "disable_primeflex", + "disable_runner_v2_reason=java_job_google_template", + "ek_regions=", + "enable_always_on_exception_sampling", + "enable_always_on_exception_sampling", + "enable_async_job_creation", + "enable_billing_v_1_5", + "enable_cloud_permissions_checking", + "enable_cmek_org_policy_check", + "enable_compute_default_service_account_org_policy", + "enable_data_sampling_telemetry", + "enable_dataprep_new_billing", + "enable_fnapi_multimap_side_input_bulk_read", + "enable_memory_sampler", + "enable_oom_sampler", + "enable_recommendations", + "enable_remote_image_ping", + "enable_secure_boot", + "enable_throttled_based_rescaling", + "enable_worker_cloud_monitoring_exporter", + "enable_worker_disk_cloud_monitoring", + "enable_worker_memory_cloud_monitoring", + "enable_zonal_outage_aware_routing", + "limit_preemptible_worker_pct", + "limit_resizing_by_cpu_util", + "min_sdk_version_to_reject_worker_in_different_region_than_service=2.44.0", + "override_controller_service_account", + "primeflex_slow_start_pct=5", + "primeflex_slow_start_seconds=3600", + "regional_physical_zone_separation_enabled", + "shuffle_mode=auto", + "shuffle_service_address_type=DIRECTPATH_WITH_CFE_FALLBACK", + "sideinput_io_metrics", + "use_dataflow_service_account_in_igm", + "use_e2_for_default_machine_type_worker_regions=africa-south1,europe-north2,europe-southwest1,europe-west10,europe-west12,europe-west8,europe-west9,me-central1,me-central2,me-west1,northamerica-south1,southamerica-west1,us-east10,us-east5,us-east7,us-south1,us-west8", + "use_job_admission_controller", + "use_multi_hop_delegation", + "use_templates_regional_bucket", + "use_worker_zone_chooser_by_default" + ], + "sdkPipelineOptions": { + "display_data": [], + "options": { + "apiRootUrl": "https://dataflow.googleapis.com/", + "appName": "FileFormatConversion", + "autoscalingAlgorithm": null, + "containsHeaders": false, + "credentialFactoryClass": "org.apache.beam.sdk.extensions.gcp.auth.GcpCredentialFactory", + "csvFileEncoding": "UTF-8", + "csvFormat": "Default", + "dataflowEndpoint": "", + "dataflowKmsKey": null, + "dataflowServiceOptions": null, + "dataflowWorkerJar": null, + "defaultEnvironmentConfig": null, + "defaultEnvironmentType": null, + "delimiter": ",", + "diskSizeGb": 0, + "enableCloudDebugger": false, + "enableStreamingEngine": false, + "environmentOptions": null, + "experiments": [ + "disable_runner_v2_reason=java_job_google_template", + "enable_always_on_exception_sampling" + ], + "filesToStage": [ + "/template/file-format-conversion/file-format-conversion.jar" + ], + "gcpTempLocation": "gs://dataflow-staging-us-central1-${projectNumber}/tmp", + "gcsPerformanceMetrics": false, + "gcsUploadBufferSizeBytes": null, + "googleApiTrace": null, + "hotKeyLoggingEnabled": false, + "inputFileFormat": "csv", + "inputFileSpec": "gs://config-connector-samples/dataflowflextemplate/numbertest.csv", + "jobName": "dataflowflextemplatejob-${uniqueId}", + "labels": { + "goog-dataflow-provided-template-name": "file_format_conversion", + "goog-dataflow-provided-template-type": "flex" + }, + "logDetailedCsvConversionErrors": false, + "maxNumWorkers": 0, + "network": null, + "numShards": 0, + "numWorkers": 0, + "numberOfWorkerHarnessThreads": 0, + "optionsId": 0, + "outputBucket": "gs://storagebucket-${uniqueId}", + "outputFileFormat": "avro", + "outputFilePrefix": "output", + "overrideWindmillBinary": null, + "pathValidatorClass": "org.apache.beam.sdk.extensions.gcp.storage.GcsPathValidator", + "pipelineUrl": "gs://dataflow-staging-us-central1-${projectNumber}/staging/pipeline-ehKedGonx8czD0ig9N0xE85y-KvEho1OrQ2jYCtevqg.pb", + "project": "${projectId}", + "recordJfrOnGcThrashing": false, + "region": "us-central1", + "resourceHints": [], + "runner": "org.apache.beam.runners.dataflow.DataflowRunner", + "saveProfilesToGcs": null, + "schema": "gs://config-connector-samples/dataflowflextemplate/numbers.avsc", + "sdkContainerImage": null, + "sdkHarnessContainerImageOverrides": null, + "serviceAccount": "${projectNumber}-compute@developer.gserviceaccount.com", + "stableUniqueNames": "WARNING", + "stagerClass": "org.apache.beam.runners.dataflow.util.GcsStager", + "stagingLocation": "gs://dataflow-staging-us-central1-${projectNumber}/staging", + "streaming": false, + "subnetwork": null, + "tempLocation": "gs://dataflow-staging-us-central1-${projectNumber}/tmp", + "templateLocation": "gs://dataflow-staging-us-central1-${projectNumber}/staging/template_launches/${jobID}/job_object", + "userAgent": "Apache_Beam_SDK_for_Java/2.41.0(JRE_11_environment)", + "workerDiskType": null, + "workerHarnessContainerImage": null, + "workerMachineType": null, + "workerRegion": null, + "zone": null + } + }, + "serviceAccountEmail": "${projectNumber}-compute@developer.gserviceaccount.com", + "shuffleMode": "SERVICE_BASED", + "tempStoragePrefix": "storage.googleapis.com/dataflow-staging-us-central1-${projectNumber}/tmp", + "userAgent": { + "removed": "simplicity" + }, + "version": { + "removed": "simplicity" + }, + "workerPools": [] + }, + "id": "000000000000000000000", + "jobMetadata": { + "removed": "simplicity" + }, + "labels": { + "goog-dataflow-provided-template-name": "file_format_conversion", + "goog-dataflow-provided-template-type": "flex" + }, + "location": "us-central1", + "name": "dataflowflextemplatejob-${uniqueId}", + "pipelineDescription": { + "removed": "simplicity" + }, + "projectId": "${projectId}", + "requestedState": "JOB_STATE_CANCELLED", + "stageStates": [], + "startTime": "2024-04-01T12:34:56.123456Z", + "steps": [], + "type": "JOB_TYPE_BATCH" +} + +--- + +GET https://dataflow.googleapis.com/v1b3/projects/${projectId}/locations/us-central1/jobs/${jobID}?alt=json&prettyPrint=false&view=JOB_VIEW_ALL +User-Agent: google-api-go-client/0.5 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 + +{ + "createTime": "2024-04-01T12:34:56.123456Z", + "currentState": "JOB_STATE_CANCELLED", + "currentStateTime": "2024-04-01T12:34:56.123456Z", + "environment": { + "dataset": "bigquery.googleapis.com/cloud_dataflow", + "experiments": [ + "auto_google_template_runner_v2", + "auto_high_core_runner_v2", + "auto_runner_v2_min_sdk=2.54.0", + "configure_shuffle_service_addresses_in_control_plane", + "delayed_launch", + "disable_baggins_exp", + "disable_primeflex", + "disable_runner_v2_reason=java_job_google_template", + "ek_regions=", + "enable_always_on_exception_sampling", + "enable_always_on_exception_sampling", + "enable_async_job_creation", + "enable_billing_v_1_5", + "enable_cloud_permissions_checking", + "enable_cmek_org_policy_check", + "enable_compute_default_service_account_org_policy", + "enable_data_sampling_telemetry", + "enable_dataprep_new_billing", + "enable_fnapi_multimap_side_input_bulk_read", + "enable_memory_sampler", + "enable_oom_sampler", + "enable_recommendations", + "enable_remote_image_ping", + "enable_secure_boot", + "enable_throttled_based_rescaling", + "enable_worker_cloud_monitoring_exporter", + "enable_worker_disk_cloud_monitoring", + "enable_worker_memory_cloud_monitoring", + "enable_zonal_outage_aware_routing", + "limit_preemptible_worker_pct", + "limit_resizing_by_cpu_util", + "min_sdk_version_to_reject_worker_in_different_region_than_service=2.44.0", + "override_controller_service_account", + "primeflex_slow_start_pct=5", + "primeflex_slow_start_seconds=3600", + "regional_physical_zone_separation_enabled", + "shuffle_mode=auto", + "shuffle_service_address_type=DIRECTPATH_WITH_CFE_FALLBACK", + "sideinput_io_metrics", + "use_dataflow_service_account_in_igm", + "use_e2_for_default_machine_type_worker_regions=africa-south1,europe-north2,europe-southwest1,europe-west10,europe-west12,europe-west8,europe-west9,me-central1,me-central2,me-west1,northamerica-south1,southamerica-west1,us-east10,us-east5,us-east7,us-south1,us-west8", + "use_job_admission_controller", + "use_multi_hop_delegation", + "use_templates_regional_bucket", + "use_worker_zone_chooser_by_default" + ], + "sdkPipelineOptions": { + "display_data": [], + "options": { + "apiRootUrl": "https://dataflow.googleapis.com/", + "appName": "FileFormatConversion", + "autoscalingAlgorithm": null, + "containsHeaders": false, + "credentialFactoryClass": "org.apache.beam.sdk.extensions.gcp.auth.GcpCredentialFactory", + "csvFileEncoding": "UTF-8", + "csvFormat": "Default", + "dataflowEndpoint": "", + "dataflowKmsKey": null, + "dataflowServiceOptions": null, + "dataflowWorkerJar": null, + "defaultEnvironmentConfig": null, + "defaultEnvironmentType": null, + "delimiter": ",", + "diskSizeGb": 0, + "enableCloudDebugger": false, + "enableStreamingEngine": false, + "environmentOptions": null, + "experiments": [ + "disable_runner_v2_reason=java_job_google_template", + "enable_always_on_exception_sampling" + ], + "filesToStage": [ + "/template/file-format-conversion/file-format-conversion.jar" + ], + "gcpTempLocation": "gs://dataflow-staging-us-central1-${projectNumber}/tmp", + "gcsPerformanceMetrics": false, + "gcsUploadBufferSizeBytes": null, + "googleApiTrace": null, + "hotKeyLoggingEnabled": false, + "inputFileFormat": "csv", + "inputFileSpec": "gs://config-connector-samples/dataflowflextemplate/numbertest.csv", + "jobName": "dataflowflextemplatejob-${uniqueId}", + "labels": { + "goog-dataflow-provided-template-name": "file_format_conversion", + "goog-dataflow-provided-template-type": "flex" + }, + "logDetailedCsvConversionErrors": false, + "maxNumWorkers": 0, + "network": null, + "numShards": 0, + "numWorkers": 0, + "numberOfWorkerHarnessThreads": 0, + "optionsId": 0, + "outputBucket": "gs://storagebucket-${uniqueId}", + "outputFileFormat": "avro", + "outputFilePrefix": "output", + "overrideWindmillBinary": null, + "pathValidatorClass": "org.apache.beam.sdk.extensions.gcp.storage.GcsPathValidator", + "pipelineUrl": "gs://dataflow-staging-us-central1-${projectNumber}/staging/pipeline-ehKedGonx8czD0ig9N0xE85y-KvEho1OrQ2jYCtevqg.pb", + "project": "${projectId}", + "recordJfrOnGcThrashing": false, + "region": "us-central1", + "resourceHints": [], + "runner": "org.apache.beam.runners.dataflow.DataflowRunner", + "saveProfilesToGcs": null, + "schema": "gs://config-connector-samples/dataflowflextemplate/numbers.avsc", + "sdkContainerImage": null, + "sdkHarnessContainerImageOverrides": null, + "serviceAccount": "${projectNumber}-compute@developer.gserviceaccount.com", + "stableUniqueNames": "WARNING", + "stagerClass": "org.apache.beam.runners.dataflow.util.GcsStager", + "stagingLocation": "gs://dataflow-staging-us-central1-${projectNumber}/staging", + "streaming": false, + "subnetwork": null, + "tempLocation": "gs://dataflow-staging-us-central1-${projectNumber}/tmp", + "templateLocation": "gs://dataflow-staging-us-central1-${projectNumber}/staging/template_launches/${jobID}/job_object", + "userAgent": "Apache_Beam_SDK_for_Java/2.41.0(JRE_11_environment)", + "workerDiskType": null, + "workerHarnessContainerImage": null, + "workerMachineType": null, + "workerRegion": null, + "zone": null + } + }, + "serviceAccountEmail": "${projectNumber}-compute@developer.gserviceaccount.com", + "shuffleMode": "SERVICE_BASED", + "tempStoragePrefix": "storage.googleapis.com/dataflow-staging-us-central1-${projectNumber}/tmp", + "userAgent": { + "removed": "simplicity" + }, + "version": { + "removed": "simplicity" + }, + "workerPools": [] + }, + "id": "000000000000000000000", + "jobMetadata": { + "removed": "simplicity" + }, + "labels": { + "goog-dataflow-provided-template-name": "file_format_conversion", + "goog-dataflow-provided-template-type": "flex" + }, + "location": "us-central1", + "name": "dataflowflextemplatejob-${uniqueId}", + "pipelineDescription": { + "removed": "simplicity" + }, + "projectId": "${projectId}", + "stageStates": [], + "startTime": "2024-04-01T12:34:56.123456Z", + "steps": [], + "type": "JOB_TYPE_BATCH" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +{ + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "604800s", + "name": "projects/${projectId}/subscriptions/pubsubsubscription-${uniqueId}", + "pushConfig": {}, + "state": "ACTIVE", + "topic": "projects/${projectId}/topics/pubsubtopic0-${uniqueId}" +} + +--- + +DELETE https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +{} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic1-${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 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/topics/pubsubtopic1-${uniqueId}" +} + +--- + +DELETE https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic1-${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 + +{} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic0-${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 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/topics/pubsubtopic0-${uniqueId}" +} + +--- + +DELETE https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic0-${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 + +{} + +--- + +GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/tables/bigquerytable${uniqueId}?alt=json&prettyPrint=false +User-Agent: google-api-go-client/0.5 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", + "etag": "abcdef0123A=", + "id": "000000000000000000000", + "kind": "bigquery#table", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lastModifiedTime": "123456789", + "location": "US", + "numActiveLogicalBytes": "0", + "numBytes": "0", + "numLongTermBytes": "0", + "numLongTermLogicalBytes": "0", + "numRows": "0", + "numTotalLogicalBytes": "0", + "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}/tables/bigquerytable${uniqueId}", + "tableReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}", + "tableId": "bigquerytable${uniqueId}" + }, + "type": "TABLE" +} + +--- + +DELETE https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/tables/bigquerytable${uniqueId}?alt=json&prettyPrint=false +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +204 No Content +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 + + +--- + +GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?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 + +{ + "access": [ + { + "role": "WRITER", + "specialGroup": "projectWriters" + }, + { + "role": "OWNER", + "specialGroup": "projectOwners" + }, + { + "role": "OWNER", + "userByEmail": "user@google.com" + }, + { + "role": "READER", + "specialGroup": "projectReaders" + } + ], + "creationTime": "123456789", + "datasetReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}" + }, + "etag": "abcdef0123A=", + "id": "000000000000000000000", + "kind": "bigquery#dataset", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lastModifiedTime": "123456789", + "location": "US", + "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}", + "type": "DEFAULT" +} + +--- + +DELETE https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?alt=json&deleteContents=false +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +204 No Content +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 \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubsubscription/basicpubsubsubscription/_generated_object_basicpubsubsubscription.golden.yaml b/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubsubscription/basicpubsubsubscription/_generated_object_basicpubsubsubscription.golden.yaml new file mode 100644 index 0000000000..1fad843da0 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubsubscription/basicpubsubsubscription/_generated_object_basicpubsubsubscription.golden.yaml @@ -0,0 +1,35 @@ +apiVersion: pubsub.cnrm.cloud.google.com/v1beta1 +kind: PubSubSubscription +metadata: + annotations: + cnrm.cloud.google.com/management-conflict-prevention-policy: none + cnrm.cloud.google.com/project-id: ${projectId} + cnrm.cloud.google.com/state-into-spec: merge + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 3 + labels: + cnrm-test: "true" + label-one: value-one + newkey: newval + name: pubsubsubscription-sample-${uniqueId} + namespace: ${uniqueId} +spec: + ackDeadlineSeconds: 20 + enableExactlyOnceDelivery: true + expirationPolicy: + ttl: 2678400s + messageRetentionDuration: 86400s + resourceID: pubsubsubscription-sample-${uniqueId} + retainAckedMessages: false + topicRef: + name: pubsubtopic-sample-${uniqueId} +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + observedGeneration: 3 diff --git a/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubsubscription/basicpubsubsubscription/_http.log b/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubsubscription/basicpubsubsubscription/_http.log new file mode 100644 index 0000000000..5509592bce --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubsubscription/basicpubsubsubscription/_http.log @@ -0,0 +1,371 @@ +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-sample-${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 + +404 Not Found +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 + +{ + "error": { + "code": 404, + "message": "Resource not found (resource=pubsubtopic-sample-${uniqueId}).", + "status": "NOT_FOUND" + } +} + +--- + +PUT https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-sample-${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 + +{ + "labels": { + "cnrm-test": "true", + "label-one": "value-one", + "managed-by-cnrm": "true" + } +} + +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 + +{ + "labels": { + "cnrm-test": "true", + "label-one": "value-one", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/topics/pubsubtopic-sample-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-sample-${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 + +{ + "labels": { + "cnrm-test": "true", + "label-one": "value-one", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/topics/pubsubtopic-sample-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-sample-${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 + +404 Not Found +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 + +{ + "error": { + "code": 404, + "message": "Resource not found (resource=pubsubsubscription-sample-${uniqueId}).", + "status": "NOT_FOUND" + } +} + +--- + +PUT https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-sample-${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 + +{ + "ackDeadlineSeconds": 15, + "deadLetterPolicy": null, + "expirationPolicy": null, + "labels": { + "cnrm-test": "true", + "label-one": "value-one", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "86400s", + "topic": "projects/${projectId}/topics/pubsubtopic-sample-${uniqueId}" +} + +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 + +{ + "ackDeadlineSeconds": 15, + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "label-one": "value-one", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "86400s", + "name": "projects/${projectId}/subscriptions/pubsubsubscription-sample-${uniqueId}", + "pushConfig": {}, + "state": "ACTIVE", + "topic": "projects/${projectId}/topics/pubsubtopic-sample-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-sample-${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 + +404 Not Found +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 + +{ + "error": { + "code": 404, + "message": "Resource not found (resource=pubsubsubscription-sample-${uniqueId}).", + "status": "NOT_FOUND" + } +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-sample-${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 + +{ + "ackDeadlineSeconds": 15, + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "label-one": "value-one", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "86400s", + "name": "projects/${projectId}/subscriptions/pubsubsubscription-sample-${uniqueId}", + "pushConfig": {}, + "state": "ACTIVE", + "topic": "projects/${projectId}/topics/pubsubtopic-sample-${uniqueId}" +} + +--- + +PATCH https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-sample-${uniqueId}?alt=json&updateMask=labels%2CackDeadlineSeconds%2CenableExactlyOnceDelivery +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "subscription": { + "ackDeadlineSeconds": 20, + "deadLetterPolicy": null, + "enableExactlyOnceDelivery": true, + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "label-one": "value-one", + "managed-by-cnrm": "true", + "newkey": "newval" + }, + "messageRetentionDuration": "86400s" + } +} + +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 + +{ + "ackDeadlineSeconds": 20, + "enableExactlyOnceDelivery": true, + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "label-one": "value-one", + "managed-by-cnrm": "true", + "newkey": "newval" + }, + "messageRetentionDuration": "86400s", + "name": "projects/${projectId}/subscriptions/pubsubsubscription-sample-${uniqueId}", + "pushConfig": { + "attributes": { + "x-goog-version": "v1" + } + }, + "state": "ACTIVE", + "topic": "projects/${projectId}/topics/pubsubtopic-sample-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-sample-${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 + +{ + "ackDeadlineSeconds": 20, + "enableExactlyOnceDelivery": true, + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "label-one": "value-one", + "managed-by-cnrm": "true", + "newkey": "newval" + }, + "messageRetentionDuration": "86400s", + "name": "projects/${projectId}/subscriptions/pubsubsubscription-sample-${uniqueId}", + "pushConfig": {}, + "state": "ACTIVE", + "topic": "projects/${projectId}/topics/pubsubtopic-sample-${uniqueId}" +} + +--- + +DELETE https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-sample-${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 + +{} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-sample-${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 + +{ + "labels": { + "cnrm-test": "true", + "label-one": "value-one", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/topics/pubsubtopic-sample-${uniqueId}" +} + +--- + +DELETE https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-sample-${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 + +{} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubsubscription/bigquerypubsubsubscription/_generated_object_bigquerypubsubsubscription.golden.yaml b/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubsubscription/bigquerypubsubsubscription/_generated_object_bigquerypubsubsubscription.golden.yaml new file mode 100644 index 0000000000..11f33d1e8c --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubsubscription/bigquerypubsubsubscription/_generated_object_bigquerypubsubsubscription.golden.yaml @@ -0,0 +1,34 @@ +apiVersion: pubsub.cnrm.cloud.google.com/v1beta1 +kind: PubSubSubscription +metadata: + annotations: + cnrm.cloud.google.com/management-conflict-prevention-policy: none + cnrm.cloud.google.com/project-id: ${projectId} + cnrm.cloud.google.com/state-into-spec: merge + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 3 + labels: + cnrm-test: "true" + label-one: value-two + name: pubsubsubscription-${uniqueId} + namespace: ${uniqueId} +spec: + bigqueryConfig: + tableRef: + name: bigquerytable-2-${uniqueId} + expirationPolicy: + ttl: 2678400s + messageRetentionDuration: 604800s + resourceID: pubsubsubscription-${uniqueId} + topicRef: + name: pubsubtopic-${uniqueId} +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + observedGeneration: 3 diff --git a/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubsubscription/bigquerypubsubsubscription/_http.log b/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubsubscription/bigquerypubsubsubscription/_http.log new file mode 100644 index 0000000000..a68ded28b8 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubsubscription/bigquerypubsubsubscription/_http.log @@ -0,0 +1,1668 @@ +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${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 + +404 Not Found +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 + +{ + "error": { + "code": 404, + "message": "Resource not found (resource=pubsubtopic-${uniqueId}).", + "status": "NOT_FOUND" + } +} + +--- + +PUT https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${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 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + } +} + +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 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${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 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +POST https://cloudresourcemanager.googleapis.com/v1/projects/${projectId}:getIamPolicy?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "options": { + "requestedPolicyVersion": 3 + } +} + +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 + +{ + "etag": "abcdef0123A=" +} + +--- + +POST https://cloudresourcemanager.googleapis.com/v1/projects/${projectId}:getIamPolicy?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "options": { + "requestedPolicyVersion": 3 + } +} + +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 + +{ + "etag": "abcdef0123A=" +} + +--- + +POST https://cloudresourcemanager.googleapis.com/v1/projects/${projectId}:getIamPolicy?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "options": { + "requestedPolicyVersion": 3 + } +} + +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 + +{ + "etag": "abcdef0123A=" +} + +--- + +POST https://cloudresourcemanager.googleapis.com/v1/projects/${projectId}:setIamPolicy?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "policy": { + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.metadataViewer" + } + ], + "etag": "abcdef0123A=", + "version": 3 + }, + "updateMask": "bindings,etag,auditConfigs" +} + +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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.metadataViewer" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +POST https://cloudresourcemanager.googleapis.com/v1/projects/${projectId}:getIamPolicy?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "options": { + "requestedPolicyVersion": 3 + } +} + +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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.metadataViewer" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +POST https://cloudresourcemanager.googleapis.com/v1/projects/${projectId}:getIamPolicy?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "options": { + "requestedPolicyVersion": 3 + } +} + +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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.metadataViewer" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +POST https://cloudresourcemanager.googleapis.com/v1/projects/${projectId}:getIamPolicy?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "options": { + "requestedPolicyVersion": 3 + } +} + +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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.metadataViewer" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +POST https://cloudresourcemanager.googleapis.com/v1/projects/${projectId}:getIamPolicy?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "options": { + "requestedPolicyVersion": 3 + } +} + +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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.metadataViewer" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +POST https://cloudresourcemanager.googleapis.com/v1/projects/${projectId}:getIamPolicy?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "options": { + "requestedPolicyVersion": 3 + } +} + +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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.metadataViewer" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +POST https://cloudresourcemanager.googleapis.com/v1/projects/${projectId}:getIamPolicy?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "options": { + "requestedPolicyVersion": 3 + } +} + +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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.metadataViewer" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +POST https://cloudresourcemanager.googleapis.com/v1/projects/${projectId}:getIamPolicy?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "options": { + "requestedPolicyVersion": 3 + } +} + +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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.metadataViewer" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +POST https://cloudresourcemanager.googleapis.com/v1/projects/${projectId}:setIamPolicy?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "policy": { + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.dataEditor" + }, + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.metadataViewer" + } + ], + "etag": "abcdef0123A=", + "version": 3 + }, + "updateMask": "bindings,etag,auditConfigs" +} + +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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.dataEditor" + }, + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.metadataViewer" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +POST https://cloudresourcemanager.googleapis.com/v1/projects/${projectId}:getIamPolicy?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "options": { + "requestedPolicyVersion": 3 + } +} + +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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.dataEditor" + }, + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.metadataViewer" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +POST https://cloudresourcemanager.googleapis.com/v1/projects/${projectId}:getIamPolicy?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "options": { + "requestedPolicyVersion": 3 + } +} + +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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.dataEditor" + }, + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.metadataViewer" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +POST https://cloudresourcemanager.googleapis.com/v1/projects/${projectId}:getIamPolicy?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "options": { + "requestedPolicyVersion": 3 + } +} + +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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.dataEditor" + }, + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.metadataViewer" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +POST https://cloudresourcemanager.googleapis.com/v1/projects/${projectId}:getIamPolicy?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "options": { + "requestedPolicyVersion": 3 + } +} + +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 + +{ + "bindings": [ + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.dataEditor" + }, + { + "members": [ + "serviceAccount:service-${projectNumber}@gcp-sa-pubsub.iam.gserviceaccount.com" + ], + "role": "roles/bigquery.metadataViewer" + } + ], + "etag": "abcdef0123A=", + "version": 1 +} + +--- + +GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?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 + +404 Not Found +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 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "Not found: Dataset ${projectId}:bigquerydataset${uniqueId}", + "reason": "notFound" + } + ], + "message": "Not found: Dataset ${projectId}:bigquerydataset${uniqueId}", + "status": "NOT_FOUND" + } +} + +--- + +POST https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets?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 + +{ + "datasetReference": { + "datasetId": "bigquerydataset${uniqueId}" + }, + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "location": "US" +} + +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 + +{ + "access": [ + { + "role": "WRITER", + "specialGroup": "projectWriters" + }, + { + "role": "OWNER", + "specialGroup": "projectOwners" + }, + { + "role": "OWNER", + "userByEmail": "user@google.com" + }, + { + "role": "READER", + "specialGroup": "projectReaders" + } + ], + "creationTime": "123456789", + "datasetReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}" + }, + "etag": "abcdef0123A=", + "id": "000000000000000000000", + "kind": "bigquery#dataset", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lastModifiedTime": "123456789", + "location": "US", + "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}", + "type": "DEFAULT" +} + +--- + +GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?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 + +{ + "access": [ + { + "role": "WRITER", + "specialGroup": "projectWriters" + }, + { + "role": "OWNER", + "specialGroup": "projectOwners" + }, + { + "role": "OWNER", + "userByEmail": "user@google.com" + }, + { + "role": "READER", + "specialGroup": "projectReaders" + } + ], + "creationTime": "123456789", + "datasetReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}" + }, + "etag": "abcdef0123A=", + "id": "000000000000000000000", + "kind": "bigquery#dataset", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lastModifiedTime": "123456789", + "location": "US", + "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}", + "type": "DEFAULT" +} + +--- + +GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/tables/bigquerytable1${uniqueId}?alt=json&prettyPrint=false +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +404 Not Found +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 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "Not found: Table ${projectId}:bigquerydataset${uniqueId}.bigquerytable1${uniqueId}", + "reason": "notFound" + } + ], + "message": "Not found: Table ${projectId}:bigquerydataset${uniqueId}.bigquerytable1${uniqueId}", + "status": "NOT_FOUND" + } +} + +--- + +POST https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/tables?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "friendlyName": "bigquerytable-1-${uniqueId}", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "schema": { + "fields": [ + { + "description": "The data", + "mode": "NULLABLE", + "name": "data", + "policyTags": {}, + "type": "STRING" + } + ] + }, + "tableReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}", + "tableId": "bigquerytable1${uniqueId}" + } +} + +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", + "etag": "abcdef0123A=", + "friendlyName": "bigquerytable-1-${uniqueId}", + "id": "000000000000000000000", + "kind": "bigquery#table", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lastModifiedTime": "123456789", + "location": "US", + "numActiveLogicalBytes": "0", + "numBytes": "0", + "numLongTermBytes": "0", + "numLongTermLogicalBytes": "0", + "numRows": "0", + "numTotalLogicalBytes": "0", + "schema": { + "fields": [ + { + "description": "The data", + "mode": "NULLABLE", + "name": "data", + "policyTags": {}, + "type": "STRING" + } + ] + }, + "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}/tables/bigquerytable1${uniqueId}", + "tableReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}", + "tableId": "bigquerytable1${uniqueId}" + }, + "type": "TABLE" +} + +--- + +GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/tables/bigquerytable1${uniqueId}?alt=json&prettyPrint=false +User-Agent: google-api-go-client/0.5 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", + "etag": "abcdef0123A=", + "friendlyName": "bigquerytable-1-${uniqueId}", + "id": "000000000000000000000", + "kind": "bigquery#table", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lastModifiedTime": "123456789", + "location": "US", + "numActiveLogicalBytes": "0", + "numBytes": "0", + "numLongTermBytes": "0", + "numLongTermLogicalBytes": "0", + "numRows": "0", + "numTotalLogicalBytes": "0", + "schema": { + "fields": [ + { + "description": "The data", + "mode": "NULLABLE", + "name": "data", + "policyTags": {}, + "type": "STRING" + } + ] + }, + "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}/tables/bigquerytable1${uniqueId}", + "tableReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}", + "tableId": "bigquerytable1${uniqueId}" + }, + "type": "TABLE" +} + +--- + +GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/tables/bigquerytable2${uniqueId}?alt=json&prettyPrint=false +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +404 Not Found +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 + +{ + "error": { + "code": 404, + "errors": [ + { + "domain": "global", + "message": "Not found: Table ${projectId}:bigquerydataset${uniqueId}.bigquerytable2${uniqueId}", + "reason": "notFound" + } + ], + "message": "Not found: Table ${projectId}:bigquerydataset${uniqueId}.bigquerytable2${uniqueId}", + "status": "NOT_FOUND" + } +} + +--- + +POST https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/tables?alt=json&prettyPrint=false +Content-Type: application/json +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "friendlyName": "bigquerytable-2-${uniqueId}", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "schema": { + "fields": [ + { + "description": "The data", + "mode": "NULLABLE", + "name": "data", + "policyTags": {}, + "type": "STRING" + } + ] + }, + "tableReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}", + "tableId": "bigquerytable2${uniqueId}" + } +} + +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", + "etag": "abcdef0123A=", + "friendlyName": "bigquerytable-2-${uniqueId}", + "id": "000000000000000000000", + "kind": "bigquery#table", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lastModifiedTime": "123456789", + "location": "US", + "numActiveLogicalBytes": "0", + "numBytes": "0", + "numLongTermBytes": "0", + "numLongTermLogicalBytes": "0", + "numRows": "0", + "numTotalLogicalBytes": "0", + "schema": { + "fields": [ + { + "description": "The data", + "mode": "NULLABLE", + "name": "data", + "policyTags": {}, + "type": "STRING" + } + ] + }, + "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}/tables/bigquerytable2${uniqueId}", + "tableReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}", + "tableId": "bigquerytable2${uniqueId}" + }, + "type": "TABLE" +} + +--- + +GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/tables/bigquerytable2${uniqueId}?alt=json&prettyPrint=false +User-Agent: google-api-go-client/0.5 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", + "etag": "abcdef0123A=", + "friendlyName": "bigquerytable-2-${uniqueId}", + "id": "000000000000000000000", + "kind": "bigquery#table", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lastModifiedTime": "123456789", + "location": "US", + "numActiveLogicalBytes": "0", + "numBytes": "0", + "numLongTermBytes": "0", + "numLongTermLogicalBytes": "0", + "numRows": "0", + "numTotalLogicalBytes": "0", + "schema": { + "fields": [ + { + "description": "The data", + "mode": "NULLABLE", + "name": "data", + "policyTags": {}, + "type": "STRING" + } + ] + }, + "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}/tables/bigquerytable2${uniqueId}", + "tableReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}", + "tableId": "bigquerytable2${uniqueId}" + }, + "type": "TABLE" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +404 Not Found +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 + +{ + "error": { + "code": 404, + "message": "Resource not found (resource=pubsubsubscription-${uniqueId}).", + "status": "NOT_FOUND" + } +} + +--- + +PUT https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +{ + "bigqueryConfig": { + "table": "${projectId}.bigquerydataset${uniqueId}.bigquerytable1${uniqueId}" + }, + "deadLetterPolicy": null, + "expirationPolicy": null, + "labels": { + "cnrm-test": "true", + "label-one": "value-one", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "604800s", + "topic": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +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 + +{ + "bigqueryConfig": { + "table": "${projectId}.bigquerydataset${uniqueId}.bigquerytable1${uniqueId}" + }, + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "label-one": "value-one", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "604800s", + "name": "projects/${projectId}/subscriptions/pubsubsubscription-${uniqueId}", + "pushConfig": {}, + "state": "ACTIVE", + "topic": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +404 Not Found +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 + +{ + "error": { + "code": 404, + "message": "Resource not found (resource=pubsubsubscription-${uniqueId}).", + "status": "NOT_FOUND" + } +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +{ + "bigqueryConfig": { + "table": "${projectId}.bigquerydataset${uniqueId}.bigquerytable1${uniqueId}" + }, + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "label-one": "value-one", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "604800s", + "name": "projects/${projectId}/subscriptions/pubsubsubscription-${uniqueId}", + "pushConfig": {}, + "state": "ACTIVE", + "topic": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +PATCH https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${uniqueId}?alt=json&updateMask=labels%2CbigqueryConfig +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "subscription": { + "bigqueryConfig": { + "table": "${projectId}.bigquerydataset${uniqueId}.bigquerytable2${uniqueId}" + }, + "deadLetterPolicy": null, + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "label-one": "value-two", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "604800s" + } +} + +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 + +{ + "bigqueryConfig": { + "table": "${projectId}.bigquerydataset${uniqueId}.bigquerytable1${uniqueId}" + }, + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "label-one": "value-two", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "604800s", + "name": "projects/${projectId}/subscriptions/pubsubsubscription-${uniqueId}", + "pushConfig": { + "attributes": { + "x-goog-version": "v1" + } + }, + "state": "ACTIVE", + "topic": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +{ + "bigqueryConfig": { + "table": "${projectId}.bigquerydataset${uniqueId}.bigquerytable1${uniqueId}" + }, + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "label-one": "value-two", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "604800s", + "name": "projects/${projectId}/subscriptions/pubsubsubscription-${uniqueId}", + "pushConfig": {}, + "state": "ACTIVE", + "topic": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +DELETE https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +{} + +--- + +GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/tables/bigquerytable2${uniqueId}?alt=json&prettyPrint=false +User-Agent: google-api-go-client/0.5 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", + "etag": "abcdef0123A=", + "friendlyName": "bigquerytable-2-${uniqueId}", + "id": "000000000000000000000", + "kind": "bigquery#table", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lastModifiedTime": "123456789", + "location": "US", + "numActiveLogicalBytes": "0", + "numBytes": "0", + "numLongTermBytes": "0", + "numLongTermLogicalBytes": "0", + "numRows": "0", + "numTotalLogicalBytes": "0", + "schema": { + "fields": [ + { + "description": "The data", + "mode": "NULLABLE", + "name": "data", + "policyTags": {}, + "type": "STRING" + } + ] + }, + "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}/tables/bigquerytable2${uniqueId}", + "tableReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}", + "tableId": "bigquerytable2${uniqueId}" + }, + "type": "TABLE" +} + +--- + +DELETE https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/tables/bigquerytable2${uniqueId}?alt=json&prettyPrint=false +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +204 No Content +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 + + +--- + +GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/tables/bigquerytable1${uniqueId}?alt=json&prettyPrint=false +User-Agent: google-api-go-client/0.5 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", + "etag": "abcdef0123A=", + "friendlyName": "bigquerytable-1-${uniqueId}", + "id": "000000000000000000000", + "kind": "bigquery#table", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lastModifiedTime": "123456789", + "location": "US", + "numActiveLogicalBytes": "0", + "numBytes": "0", + "numLongTermBytes": "0", + "numLongTermLogicalBytes": "0", + "numRows": "0", + "numTotalLogicalBytes": "0", + "schema": { + "fields": [ + { + "description": "The data", + "mode": "NULLABLE", + "name": "data", + "policyTags": {}, + "type": "STRING" + } + ] + }, + "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}/tables/bigquerytable1${uniqueId}", + "tableReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}", + "tableId": "bigquerytable1${uniqueId}" + }, + "type": "TABLE" +} + +--- + +DELETE https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}/tables/bigquerytable1${uniqueId}?alt=json&prettyPrint=false +User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +204 No Content +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 + + +--- + +GET https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?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 + +{ + "access": [ + { + "role": "WRITER", + "specialGroup": "projectWriters" + }, + { + "role": "OWNER", + "specialGroup": "projectOwners" + }, + { + "role": "OWNER", + "userByEmail": "user@google.com" + }, + { + "role": "READER", + "specialGroup": "projectReaders" + } + ], + "creationTime": "123456789", + "datasetReference": { + "datasetId": "bigquerydataset${uniqueId}", + "projectId": "${projectId}" + }, + "etag": "abcdef0123A=", + "id": "000000000000000000000", + "kind": "bigquery#dataset", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "lastModifiedTime": "123456789", + "location": "US", + "selfLink": "https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/bigquerydataset${uniqueId}", + "type": "DEFAULT" +} + +--- + +DELETE https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/datasets/${datasetID}?alt=json&deleteContents=false +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +204 No Content +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 + + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${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 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +DELETE https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${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 + +{} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubtopic/_generated_object_pubsubtopic.golden.yaml b/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubtopic/_generated_object_pubsubtopic.golden.yaml index eb5dd8efa9..8334e0f7b9 100644 --- a/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubtopic/_generated_object_pubsubtopic.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubtopic/_generated_object_pubsubtopic.golden.yaml @@ -16,30 +16,6 @@ metadata: name: pubsubtopic-sample-${uniqueId} namespace: ${uniqueId} spec: - messageStoragePolicy: - allowedPersistenceRegions: - - asia-east1 - - asia-northeast1 - - asia-southeast1 - - australia-southeast1 - - europe-north1 - - europe-west1 - - europe-west2 - - europe-west3 - - europe-west4 - - southamerica-west1 - - us-central1 - - us-central2 - - us-east1 - - us-east4 - - us-east5 - - us-east7 - - us-south1 - - us-west1 - - us-west2 - - us-west3 - - us-west4 - - us-west8 resourceID: pubsubtopic-sample-${uniqueId} schemaSettings: encoding: JSON diff --git a/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubtopic/_http.log b/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubtopic/_http.log index 50b2a6d7b8..5d670032b4 100644 --- a/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubtopic/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/pubsub/v1beta1/pubsubtopic/_http.log @@ -137,32 +137,6 @@ X-Xss-Protection: 0 "label-one": "value-one", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-sample-${uniqueId}", "schemaSettings": { "encoding": "JSON", @@ -193,32 +167,6 @@ X-Xss-Protection: 0 "label-one": "value-one", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-sample-${uniqueId}", "schemaSettings": { "encoding": "JSON", diff --git a/pkg/test/resourcefixture/testdata/basic/secretmanager/v1beta1/secretmanagersecret/_http.log b/pkg/test/resourcefixture/testdata/basic/secretmanager/v1beta1/secretmanagersecret/_http.log index 8f4a928e6e..f3ca960729 100644 --- a/pkg/test/resourcefixture/testdata/basic/secretmanager/v1beta1/secretmanagersecret/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/secretmanager/v1beta1/secretmanagersecret/_http.log @@ -50,32 +50,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/topic-${uniqueId}" } @@ -101,32 +75,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/topic-${uniqueId}" } @@ -479,32 +427,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/topic-${uniqueId}" } diff --git a/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationbase/_http.log b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationbase/_http.log index af392d739b..82d3a82017 100644 --- a/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationbase/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationbase/_http.log @@ -189,32 +189,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" } @@ -240,32 +214,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" } @@ -512,32 +460,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" } diff --git a/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/_http.log b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/_http.log index 99f5603ab4..f4b9d8c974 100644 --- a/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/storage/v1beta1/storagenotification/storagenotificationfull/_http.log @@ -189,32 +189,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" } @@ -240,32 +214,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" } @@ -539,32 +487,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" } diff --git a/pkg/test/resourcefixture/testdata/externalref/externalwithname/_generated_object_externalwithname.golden.yaml b/pkg/test/resourcefixture/testdata/externalref/externalwithname/_generated_object_externalwithname.golden.yaml new file mode 100644 index 0000000000..2d4807897f --- /dev/null +++ b/pkg/test/resourcefixture/testdata/externalref/externalwithname/_generated_object_externalwithname.golden.yaml @@ -0,0 +1,31 @@ +apiVersion: pubsub.cnrm.cloud.google.com/v1beta1 +kind: PubSubSubscription +metadata: + annotations: + cnrm.cloud.google.com/management-conflict-prevention-policy: none + cnrm.cloud.google.com/project-id: ${projectId} + cnrm.cloud.google.com/state-into-spec: merge + finalizers: + - cnrm.cloud.google.com/finalizer + - cnrm.cloud.google.com/deletion-defender + generation: 3 + labels: + cnrm-test: "true" + name: pubsubsubscription-${uniqueId} + namespace: ${uniqueId} +spec: + ackDeadlineSeconds: 20 + expirationPolicy: + ttl: 2678400s + messageRetentionDuration: 604800s + resourceID: pubsubsubscription-${uniqueId} + topicRef: + external: pubsubtopic-${uniqueId} +status: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: The resource is up to date + reason: UpToDate + status: "True" + type: Ready + observedGeneration: 3 diff --git a/pkg/test/resourcefixture/testdata/externalref/externalwithname/_http.log b/pkg/test/resourcefixture/testdata/externalref/externalwithname/_http.log new file mode 100644 index 0000000000..07026bbbc6 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/externalref/externalwithname/_http.log @@ -0,0 +1,355 @@ +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${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 + +404 Not Found +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 + +{ + "error": { + "code": 404, + "message": "Resource not found (resource=pubsubtopic-${uniqueId}).", + "status": "NOT_FOUND" + } +} + +--- + +PUT https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${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 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + } +} + +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 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${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 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +404 Not Found +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 + +{ + "error": { + "code": 404, + "message": "Resource not found (resource=pubsubsubscription-${uniqueId}).", + "status": "NOT_FOUND" + } +} + +--- + +PUT https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +{ + "ackDeadlineSeconds": 15, + "deadLetterPolicy": null, + "expirationPolicy": null, + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "604800s", + "topic": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +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 + +{ + "ackDeadlineSeconds": 15, + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "604800s", + "name": "projects/${projectId}/subscriptions/pubsubsubscription-${uniqueId}", + "pushConfig": {}, + "state": "ACTIVE", + "topic": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +404 Not Found +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 + +{ + "error": { + "code": 404, + "message": "Resource not found (resource=pubsubsubscription-${uniqueId}).", + "status": "NOT_FOUND" + } +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +{ + "ackDeadlineSeconds": 15, + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "604800s", + "name": "projects/${projectId}/subscriptions/pubsubsubscription-${uniqueId}", + "pushConfig": {}, + "state": "ACTIVE", + "topic": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +PATCH https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${uniqueId}?alt=json&updateMask=ackDeadlineSeconds +Content-Type: application/json +User-Agent: Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager + +{ + "subscription": { + "ackDeadlineSeconds": 20, + "deadLetterPolicy": null, + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "604800s" + } +} + +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 + +{ + "ackDeadlineSeconds": 20, + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "604800s", + "name": "projects/${projectId}/subscriptions/pubsubsubscription-${uniqueId}", + "pushConfig": { + "attributes": { + "x-goog-version": "v1" + } + }, + "state": "ACTIVE", + "topic": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +{ + "ackDeadlineSeconds": 20, + "expirationPolicy": { + "ttl": "2678400s" + }, + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "messageRetentionDuration": "604800s", + "name": "projects/${projectId}/subscriptions/pubsubsubscription-${uniqueId}", + "pushConfig": {}, + "state": "ACTIVE", + "topic": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +DELETE https://pubsub.googleapis.com/v1/projects/${projectId}/subscriptions/pubsubsubscription-${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 + +{} + +--- + +GET https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${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 + +{ + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" +} + +--- + +DELETE https://pubsub.googleapis.com/v1/projects/${projectId}/topics/pubsubtopic-${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 + +{} \ No newline at end of file diff --git a/pkg/test/resourcefixture/testdata/iammemberreferences/serviceaccountref/_http.log b/pkg/test/resourcefixture/testdata/iammemberreferences/serviceaccountref/_http.log index e102c0db58..55a868f89e 100644 --- a/pkg/test/resourcefixture/testdata/iammemberreferences/serviceaccountref/_http.log +++ b/pkg/test/resourcefixture/testdata/iammemberreferences/serviceaccountref/_http.log @@ -137,32 +137,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" } @@ -188,32 +162,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" } @@ -386,32 +334,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" } diff --git a/pkg/test/resourcefixture/testdata/iammemberreferences/sqlinstanceref/_http.log b/pkg/test/resourcefixture/testdata/iammemberreferences/sqlinstanceref/_http.log index 8578b7d573..a44ee336e5 100644 --- a/pkg/test/resourcefixture/testdata/iammemberreferences/sqlinstanceref/_http.log +++ b/pkg/test/resourcefixture/testdata/iammemberreferences/sqlinstanceref/_http.log @@ -419,32 +419,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" } @@ -470,32 +444,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" } @@ -668,32 +616,6 @@ X-Xss-Protection: 0 "cnrm-test": "true", "managed-by-cnrm": "true" }, - "messageStoragePolicy": { - "allowedPersistenceRegions": [ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8" - ] - }, "name": "projects/${projectId}/topics/pubsubtopic-${uniqueId}" } From 0c85a795775e364283a79587c136b64ee061911d Mon Sep 17 00:00:00 2001 From: justinsb Date: Sat, 17 Aug 2024 16:01:51 -0400 Subject: [PATCH 2/3] mockgcp: support for PubSubSubscription --- config/tests/samples/create/harness.go | 1 + mockgcp/mockpubsub/service.go | 2 +- mockgcp/mockpubsub/subscription.go | 227 +++++++++++++++++++++++++ mockgcp/mockpubsub/topic.go | 57 ++++--- mockgcp/mockpubsub/utils.go | 22 +++ 5 files changed, 282 insertions(+), 27 deletions(-) create mode 100644 mockgcp/mockpubsub/subscription.go create mode 100644 mockgcp/mockpubsub/utils.go diff --git a/config/tests/samples/create/harness.go b/config/tests/samples/create/harness.go index 41d820497e..f758c6f16d 100644 --- a/config/tests/samples/create/harness.go +++ b/config/tests/samples/create/harness.go @@ -718,6 +718,7 @@ func MaybeSkip(t *testing.T, name string, resources []*unstructured.Unstructured case schema.GroupKind{Group: "privilegedaccessmanager.cnrm.google.com", Kind: "PrivilegedAccessManagerEntitlement"}: case schema.GroupKind{Group: "pubsub.cnrm.cloud.google.com", Kind: "PubSubSchema"}: + case schema.GroupKind{Group: "pubsub.cnrm.cloud.google.com", Kind: "PubSubSubscription"}: case schema.GroupKind{Group: "pubsub.cnrm.cloud.google.com", Kind: "PubSubTopic"}: case schema.GroupKind{Group: "redis.cnrm.cloud.google.com", Kind: "RedisInstance"}: diff --git a/mockgcp/mockpubsub/service.go b/mockgcp/mockpubsub/service.go index e006a0fe97..64590d3da5 100644 --- a/mockgcp/mockpubsub/service.go +++ b/mockgcp/mockpubsub/service.go @@ -50,7 +50,7 @@ func (s *MockService) ExpectedHosts() []string { func (s *MockService) Register(grpcServer *grpc.Server) { pb.RegisterPublisherServer(grpcServer, &publisherService{MockService: s}) - // pb.RegisterSubscriberServer(grpcServer, &subscriberService{MockService: s}) + pb.RegisterSubscriberServer(grpcServer, &subscriberService{MockService: s}) pb.RegisterSchemaServiceServer(grpcServer, &schemaService{MockService: s}) } diff --git a/mockgcp/mockpubsub/subscription.go b/mockgcp/mockpubsub/subscription.go new file mode 100644 index 0000000000..932819cb20 --- /dev/null +++ b/mockgcp/mockpubsub/subscription.go @@ -0,0 +1,227 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package mockpubsub + +import ( + "context" + "fmt" + "strings" + "time" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/durationpb" + "google.golang.org/protobuf/types/known/emptypb" + "k8s.io/klog/v2" + + "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/common/projects" + pb "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/generated/mockgcp/pubsub/v1" + "github.com/GoogleCloudPlatform/k8s-config-connector/mockgcp/pkg/storage" +) + +type subscriberService struct { + *MockService + pb.UnimplementedSubscriberServer +} + +func (s *subscriberService) CreateSubscription(ctx context.Context, req *pb.Subscription) (*pb.Subscription, error) { + name, err := s.parseSubscriptionName(req.Name) + if err != nil { + return nil, err + } + fqn := name.String() + + obj := ProtoClone(req) + obj.Name = name.String() + + obj.State = pb.Subscription_ACTIVE + + s.populateDefaultsForSubscription(obj) + + // Unlike many other APIs, creation is eventually consistent (not immediately visible in GET) + go func() { + ctx := context.Background() + time.Sleep(2 * time.Second) + if err := s.storage.Create(ctx, fqn, obj); err != nil { + klog.Errorf("error creaing pubsub Subscription: %v", err) + } + }() + + return obj, nil +} + +func (s *subscriberService) populateDefaultsForSubscription(obj *pb.Subscription) { + if obj.ExpirationPolicy == nil { + obj.ExpirationPolicy = &pb.ExpirationPolicy{ + Ttl: &durationpb.Duration{ + Seconds: 3600 * 24 * 31, + }, + } + } + + if obj.PushConfig == nil { + obj.PushConfig = &pb.PushConfig{} + } + +} + +func (s *subscriberService) UpdateSubscription(ctx context.Context, req *pb.UpdateSubscriptionRequest) (*pb.Subscription, error) { + reqName := req.Subscription.Name + name, err := s.parseSubscriptionName(reqName) + if err != nil { + return nil, err + } + fqn := name.String() + existing := &pb.Subscription{} + if err := s.storage.Get(ctx, fqn, existing); err != nil { + return nil, err + } + + updated := ProtoClone(existing) + updated.Name = name.String() + + // Required. The update mask applies to the resource. + paths := req.GetUpdateMask().GetPaths() + if len(paths) == 0 { + // Documented as required, but not passed by terraform... + // return nil, status.Errorf(codes.InvalidArgument, "update_mask is required") + updated.AckDeadlineSeconds = req.GetSubscription().AckDeadlineSeconds + updated.EnableExactlyOnceDelivery = req.GetSubscription().EnableExactlyOnceDelivery + updated.Labels = req.GetSubscription().Labels + updated.PushConfig = req.GetSubscription().PushConfig + } + // TODO: Some sort of helper for fieldmask? + for _, path := range paths { + switch path { + case "ackDeadlineSeconds": + updated.AckDeadlineSeconds = req.GetSubscription().AckDeadlineSeconds + case "enableExactlyOnceDelivery": + updated.EnableExactlyOnceDelivery = req.GetSubscription().EnableExactlyOnceDelivery + case "labels": + updated.Labels = req.GetSubscription().Labels + case "pushConfig": + updated.PushConfig = req.GetSubscription().PushConfig + // case "expirationPolicy": + // updated.ExpirationPolicy = req.GetSubscription().ExpirationPolicy + default: + return nil, status.Errorf(codes.InvalidArgument, "update_mask path %q not supported by mock", path) + } + } + + s.populateDefaultsForSubscription(updated) + + if err := s.storage.Update(ctx, fqn, updated); err != nil { + return nil, err + } + + // Very unusual behaviour on the return value pushConfig ... maybe this is actually async also? + ret := ProtoClone(updated) + if ret.PushConfig == nil { + ret.PushConfig = &pb.PushConfig{} + } + if ret.PushConfig.Attributes == nil { + ret.PushConfig.Attributes = make(map[string]string) + } + if ret.PushConfig.Attributes["x-goog-version"] == "" { + ret.PushConfig.Attributes["x-goog-version"] = "v1" + } + return ret, nil +} + +func (s *subscriberService) GetSubscription(ctx context.Context, req *pb.GetSubscriptionRequest) (*pb.Subscription, error) { + name, err := s.parseSubscriptionName(req.Subscription) + if err != nil { + return nil, err + } + fqn := name.String() + obj := &pb.Subscription{} + if err := s.storage.Get(ctx, fqn, obj); err != nil { + if status.Code(err) == codes.NotFound { + return nil, status.Errorf(codes.NotFound, "Resource not found (resource=%s).", name.ID) + } + return nil, err + } + + return obj, nil +} + +func (s *subscriberService) ListSubscriptions(ctx context.Context, req *pb.ListSubscriptionsRequest) (*pb.ListSubscriptionsResponse, error) { + project, err := s.Projects.GetProjectByID(req.Project) + if err != nil { + return nil, err + } + + findPrefix := fmt.Sprintf("projects/%v/", project.ID) + + var subscriptions []*pb.Subscription + + subscriptionKind := (&pb.Subscription{}).ProtoReflect().Descriptor() + if err := s.storage.List(ctx, subscriptionKind, storage.ListOptions{}, func(obj proto.Message) error { + subscription := obj.(*pb.Subscription) + if strings.HasPrefix(subscription.Name, findPrefix) { + subscriptions = append(subscriptions, subscription) + } + return nil + }); err != nil { + return nil, err + } + + return &pb.ListSubscriptionsResponse{ + Subscriptions: subscriptions, + NextPageToken: "", + }, nil +} + +func (s *subscriberService) DeleteSubscription(ctx context.Context, req *pb.DeleteSubscriptionRequest) (*emptypb.Empty, error) { + name, err := s.parseSubscriptionName(req.Subscription) + if err != nil { + return nil, err + } + fqn := name.String() + deletedObj := &pb.Subscription{} + if err := s.storage.Delete(ctx, fqn, deletedObj); err != nil { + return nil, err + } + return &emptypb.Empty{}, nil +} + +type subscriptionName struct { + Project *projects.ProjectData + ID string +} + +func (n *subscriptionName) String() string { + return fmt.Sprintf("projects/%s/subscriptions/%s", n.Project.ID, n.ID) +} + +// parseSubscriptionName parses a string into a subscriptionName. +// The expected form is `projects/*/subscriptions/*`. +func (s *MockService) parseSubscriptionName(name string) (*subscriptionName, error) { + tokens := strings.Split(name, "/") + if len(tokens) == 4 && tokens[0] == "projects" && tokens[2] == "subscriptions" { + project, err := s.Projects.GetProjectByID(tokens[1]) + if err != nil { + return nil, err + } + name := &subscriptionName{ + Project: project, + ID: tokens[3], + } + return name, nil + } else { + return nil, status.Errorf(codes.InvalidArgument, "name %q is not valid", name) + } +} diff --git a/mockgcp/mockpubsub/topic.go b/mockgcp/mockpubsub/topic.go index 52b088bcd5..0f73cc92d7 100644 --- a/mockgcp/mockpubsub/topic.go +++ b/mockgcp/mockpubsub/topic.go @@ -48,35 +48,40 @@ func (s *publisherService) CreateTopic(ctx context.Context, req *pb.Topic) (*pb. if err := s.storage.Create(ctx, fqn, obj); err != nil { return nil, err } + return obj, nil } func (s *publisherService) populateDefaultsForTopic(obj *pb.Topic) { - obj.MessageStoragePolicy = &pb.MessageStoragePolicy{ - AllowedPersistenceRegions: []string{ - "asia-east1", - "asia-northeast1", - "asia-southeast1", - "australia-southeast1", - "europe-north1", - "europe-west1", - "europe-west2", - "europe-west3", - "europe-west4", - "southamerica-west1", - "us-central1", - "us-central2", - "us-east1", - "us-east4", - "us-east5", - "us-east7", - "us-south1", - "us-west1", - "us-west2", - "us-west3", - "us-west4", - "us-west8", - }, + // TODO: When _is_ this populated? + populateMessageStoragePolicy := false + if populateMessageStoragePolicy { + obj.MessageStoragePolicy = &pb.MessageStoragePolicy{ + AllowedPersistenceRegions: []string{ + "asia-east1", + "asia-northeast1", + "asia-southeast1", + "australia-southeast1", + "europe-north1", + "europe-west1", + "europe-west2", + "europe-west3", + "europe-west4", + "southamerica-west1", + "us-central1", + "us-central2", + "us-east1", + "us-east4", + "us-east5", + "us-east7", + "us-south1", + "us-west1", + "us-west2", + "us-west3", + "us-west4", + "us-west8", + }, + } } } @@ -92,7 +97,7 @@ func (s *publisherService) UpdateTopic(ctx context.Context, req *pb.UpdateTopicR return nil, err } - updated := req.GetTopic() + updated := ProtoClone(existing) updated.Name = name.String() // Required. The update mask applies to the resource. diff --git a/mockgcp/mockpubsub/utils.go b/mockgcp/mockpubsub/utils.go new file mode 100644 index 0000000000..a6ef3307c8 --- /dev/null +++ b/mockgcp/mockpubsub/utils.go @@ -0,0 +1,22 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package mockpubsub + +import "google.golang.org/protobuf/proto" + +// ProtoClone is a type-safe wrapper around proto.Clone +func ProtoClone[T proto.Message](t T) T { + return proto.Clone(t).(T) +} From 66797431ee1ac17371eff1d2569cace5ca580094 Mon Sep 17 00:00:00 2001 From: justinsb Date: Mon, 26 Aug 2024 09:30:22 -0400 Subject: [PATCH 3/3] mockgcp: add support for Draining to DataflowFlexTemplateJob --- mockgcp/mockdataflow/jobs.go | 6 +++++- mockgcp/mockdataflow/workflows.go | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mockgcp/mockdataflow/jobs.go b/mockgcp/mockdataflow/jobs.go index ed0f3b1c98..32eedc4646 100644 --- a/mockgcp/mockdataflow/jobs.go +++ b/mockgcp/mockdataflow/jobs.go @@ -74,8 +74,12 @@ func (r *jobsServer) UpdateJob(ctx context.Context, req *pb.UpdateJobRequest) (* obj.CurrentState = pb.JobState_JOB_STATE_CANCELLING obj.CurrentStateTime = timestamppb.New(now) obj.RequestedState = pb.JobState_JOB_STATE_CANCELLED + case pb.JobState_JOB_STATE_DRAINING: + obj.CurrentState = pb.JobState_JOB_STATE_DRAINING + obj.CurrentStateTime = timestamppb.New(now) + obj.RequestedState = pb.JobState_JOB_STATE_DRAINING default: - return nil, status.Errorf(codes.InvalidArgument, "unhandled requestedState in mock") + return nil, status.Errorf(codes.InvalidArgument, "unhandled requestedState %v in mock", req.GetJob()) } if err := r.storage.Update(ctx, fqn, obj); err != nil { diff --git a/mockgcp/mockdataflow/workflows.go b/mockgcp/mockdataflow/workflows.go index 19c64c5aa9..ebafd95471 100644 --- a/mockgcp/mockdataflow/workflows.go +++ b/mockgcp/mockdataflow/workflows.go @@ -42,6 +42,10 @@ func (r *MockService) StopJob(fqn string) error { obj.CurrentState = pb.JobState_JOB_STATE_CANCELLED obj.CurrentStateTime = timestamppb.New(now) obj.RequestedState = pb.JobState_JOB_STATE_UNKNOWN + case pb.JobState_JOB_STATE_DRAINING: + obj.CurrentState = pb.JobState_JOB_STATE_DRAINED + obj.CurrentStateTime = timestamppb.New(now) + obj.RequestedState = pb.JobState_JOB_STATE_UNKNOWN default: return fmt.Errorf("unexpected state for job %q: %v", fqn, obj.CurrentState) }