From 712924cb719274408991d9003644564e04c91bc8 Mon Sep 17 00:00:00 2001 From: justinsb Date: Fri, 26 Apr 2024 11:33:27 -0400 Subject: [PATCH] tests: capture golden output for bigtabletable test This uses our new GRPC collection infrastructure. --- ...generated_object_bigtabletable.golden.yaml | 47 ++ .../bigtable/v1beta1/bigtabletable/_http.log | 521 ++++++++++++++++++ 2 files changed, 568 insertions(+) create mode 100644 pkg/test/resourcefixture/testdata/basic/bigtable/v1beta1/bigtabletable/_generated_object_bigtabletable.golden.yaml create mode 100644 pkg/test/resourcefixture/testdata/basic/bigtable/v1beta1/bigtabletable/_http.log diff --git a/pkg/test/resourcefixture/testdata/basic/bigtable/v1beta1/bigtabletable/_generated_object_bigtabletable.golden.yaml b/pkg/test/resourcefixture/testdata/basic/bigtable/v1beta1/bigtabletable/_generated_object_bigtabletable.golden.yaml new file mode 100644 index 0000000000..6edde25012 --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/bigtable/v1beta1/bigtabletable/_generated_object_bigtabletable.golden.yaml @@ -0,0 +1,47 @@ +# 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. + +apiVersion: bigtable.cnrm.cloud.google.com/v1beta1 +kind: BigtableTable +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: bigtabletable-${uniqueId} + namespace: ${uniqueId} +spec: + columnFamily: + - family: family3 + - family: family2 + deletionProtection: UNPROTECTED + instanceRef: + name: bigtable-dep-${uniqueId} + resourceID: bigtabletable-${uniqueId} + splitKeys: + - a +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/bigtable/v1beta1/bigtabletable/_http.log b/pkg/test/resourcefixture/testdata/basic/bigtable/v1beta1/bigtabletable/_http.log new file mode 100644 index 0000000000..b42a1370df --- /dev/null +++ b/pkg/test/resourcefixture/testdata/basic/bigtable/v1beta1/bigtabletable/_http.log @@ -0,0 +1,521 @@ +GRPC /google.bigtable.admin.v2.BigtableInstanceAdmin/ListInstances + +{ + "parent": "projects/${projectId}" +} + +OK + +{} + +--- + +GRPC /google.bigtable.admin.v2.BigtableInstanceAdmin/CreateInstance + +{ + "clusters": { + "cluster1-${uniqueId}": { + "defaultStorageType": "SSD", + "encryptionConfig": {}, + "location": "projects/${projectId}/locations/us-east1-b", + "serveNodes": 3 + }, + "cluster2-${uniqueId}": { + "defaultStorageType": "SSD", + "encryptionConfig": {}, + "location": "projects/${projectId}/locations/us-west1-a", + "serveNodes": 3 + } + }, + "instance": { + "displayName": "BigtableSample", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "type": "PRODUCTION" + }, + "instanceId": "bigtable-dep-${uniqueId}", + "parent": "projects/${projectId}" +} + +OK + +{ + "metadata": { + "@type": "type.googleapis.com/google.bigtable.admin.v2.CreateInstanceMetadata", + "originalRequest": { + "clusters": { + "cluster1-${uniqueId}": { + "defaultStorageType": "SSD", + "location": "projects/${projectId}/locations/us-east1-b", + "serveNodes": 3 + }, + "cluster2-${uniqueId}": { + "defaultStorageType": "SSD", + "location": "projects/${projectId}/locations/us-west1-a", + "serveNodes": 3 + } + }, + "instance": { + "displayName": "BigtableSample", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "type": "PRODUCTION" + }, + "instanceId": "bigtable-dep-${uniqueId}", + "parent": "projects/${projectId}" + }, + "requestTime": "9999-12-31T23:59:59.999999999Z" + }, + "name": "operations/projects/${projectId}/instances/bigtable-dep-${uniqueId}/locations/us-west1-a/operations/1494670242314888474" +} + +--- + +GRPC /google.longrunning.Operations/GetOperation + +{ + "name": "operations/projects/${projectId}/instances/bigtable-dep-${uniqueId}/locations/us-west1-a/operations/1494670242314888474" +} + +OK + +{ + "done": true, + "metadata": { + "@type": "type.googleapis.com/google.bigtable.admin.v2.CreateInstanceMetadata", + "finishTime": "2024-04-26T15:32:45.058427Z", + "originalRequest": { + "clusters": { + "cluster1-${uniqueId}": { + "defaultStorageType": "SSD", + "location": "projects/${projectId}/locations/us-east1-b", + "serveNodes": 3 + }, + "cluster2-${uniqueId}": { + "defaultStorageType": "SSD", + "location": "projects/${projectId}/locations/us-west1-a", + "serveNodes": 3 + } + }, + "instance": { + "displayName": "BigtableSample", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "type": "PRODUCTION" + }, + "instanceId": "bigtable-dep-${uniqueId}", + "parent": "projects/${projectId}" + }, + "requestTime": "2024-04-26T15:32:42.198085Z" + }, + "name": "operations/projects/${projectId}/instances/bigtable-dep-${uniqueId}/locations/us-west1-a/operations/1494670242314888474", + "response": { + "@type": "type.googleapis.com/google.bigtable.admin.v2.Instance", + "displayName": "BigtableSample", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}", + "state": "READY", + "type": "PRODUCTION" + } +} + +--- + +GRPC /google.bigtable.admin.v2.BigtableInstanceAdmin/ListInstances + +{ + "parent": "projects/${projectId}" +} + +OK + +{ + "instances": [ + { + "createTime": "2024-04-26T15:32:42.198085Z", + "displayName": "BigtableSample", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}", + "state": "READY", + "type": "PRODUCTION" + } + ] +} + +--- + +GRPC /google.bigtable.admin.v2.BigtableInstanceAdmin/ListClusters + +{ + "parent": "projects/${projectId}/instances/bigtable-dep-${uniqueId}" +} + +OK + +{ + "clusters": [ + { + "defaultStorageType": "SSD", + "location": "projects/${projectId}/locations/us-west1-a", + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/clusters/cluster2-${uniqueId}", + "serveNodes": 3, + "state": "READY" + }, + { + "defaultStorageType": "SSD", + "location": "projects/${projectId}/locations/us-east1-b", + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/clusters/cluster1-${uniqueId}", + "serveNodes": 3, + "state": "READY" + } + ] +} + +--- + +GRPC /google.bigtable.admin.v2.BigtableInstanceAdmin/ListInstances + +{ + "parent": "projects/${projectId}" +} + +OK + +{ + "instances": [ + { + "createTime": "2024-04-26T15:32:42.198085Z", + "displayName": "BigtableSample", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}", + "state": "READY", + "type": "PRODUCTION" + } + ] +} + +--- + +GRPC /google.bigtable.admin.v2.BigtableInstanceAdmin/ListClusters + +{ + "parent": "projects/${projectId}/instances/bigtable-dep-${uniqueId}" +} + +OK + +{ + "clusters": [ + { + "defaultStorageType": "SSD", + "location": "projects/${projectId}/locations/us-west1-a", + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/clusters/cluster2-${uniqueId}", + "serveNodes": 3, + "state": "READY" + }, + { + "defaultStorageType": "SSD", + "location": "projects/${projectId}/locations/us-east1-b", + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/clusters/cluster1-${uniqueId}", + "serveNodes": 3, + "state": "READY" + } + ] +} + +--- + +GRPC /google.bigtable.admin.v2.BigtableTableAdmin/GetTable + +{ + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}", + "view": "SCHEMA_VIEW" +} + +error: rpc error: code = NotFound desc = Table not found: projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId} + +{} + +--- + +GRPC /google.bigtable.admin.v2.BigtableTableAdmin/CreateTable + +{ + "initialSplits": [ + { + "key": "YQ==" + } + ], + "parent": "projects/${projectId}/instances/bigtable-dep-${uniqueId}", + "table": { + "columnFamilies": { + "family1": { + "gcRule": {} + }, + "family2": { + "gcRule": {} + } + } + }, + "tableId": "bigtabletable-${uniqueId}" +} + +OK + +{ + "columnFamilies": { + "family1": { + "gcRule": {} + }, + "family2": { + "gcRule": {} + } + }, + "granularity": "MILLIS", + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}" +} + +--- + +GRPC /google.bigtable.admin.v2.BigtableTableAdmin/GetTable + +{ + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}", + "view": "SCHEMA_VIEW" +} + +OK + +{ + "columnFamilies": { + "family1": {}, + "family2": {} + }, + "granularity": "MILLIS", + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}" +} + +--- + +GRPC /google.bigtable.admin.v2.BigtableTableAdmin/GetTable + +{ + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}", + "view": "SCHEMA_VIEW" +} + +OK + +{ + "columnFamilies": { + "family1": {}, + "family2": {} + }, + "granularity": "MILLIS", + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}" +} + +--- + +GRPC /google.bigtable.admin.v2.BigtableTableAdmin/GetTable + +{ + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}", + "view": "SCHEMA_VIEW" +} + +OK + +{ + "columnFamilies": { + "family1": {}, + "family2": {} + }, + "granularity": "MILLIS", + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}" +} + +--- + +GRPC /google.bigtable.admin.v2.BigtableTableAdmin/ModifyColumnFamilies + +{ + "modifications": [ + { + "create": {}, + "id": "family3" + } + ], + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}" +} + +OK + +{ + "columnFamilies": { + "family1": {}, + "family2": {}, + "family3": {} + }, + "granularity": "MILLIS", + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}" +} + +--- + +GRPC /google.bigtable.admin.v2.BigtableTableAdmin/ModifyColumnFamilies + +{ + "modifications": [ + { + "drop": true, + "id": "family1" + } + ], + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}" +} + +OK + +{ + "columnFamilies": { + "family2": {}, + "family3": {} + }, + "granularity": "MILLIS", + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}" +} + +--- + +GRPC /google.bigtable.admin.v2.BigtableTableAdmin/GetTable + +{ + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}", + "view": "SCHEMA_VIEW" +} + +OK + +{ + "columnFamilies": { + "family2": {}, + "family3": {} + }, + "granularity": "MILLIS", + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}" +} + +--- + +GRPC /google.bigtable.admin.v2.BigtableTableAdmin/GetTable + +{ + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}", + "view": "SCHEMA_VIEW" +} + +OK + +{ + "columnFamilies": { + "family2": {}, + "family3": {} + }, + "granularity": "MILLIS", + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}" +} + +--- + +GRPC /google.bigtable.admin.v2.BigtableTableAdmin/DeleteTable + +{ + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/tables/bigtabletable-${uniqueId}" +} + +OK + +{} + +--- + +GRPC /google.bigtable.admin.v2.BigtableInstanceAdmin/ListInstances + +{ + "parent": "projects/${projectId}" +} + +OK + +{ + "instances": [ + { + "createTime": "2024-04-26T15:32:42.198085Z", + "displayName": "BigtableSample", + "labels": { + "cnrm-test": "true", + "managed-by-cnrm": "true" + }, + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}", + "state": "READY", + "type": "PRODUCTION" + } + ] +} + +--- + +GRPC /google.bigtable.admin.v2.BigtableInstanceAdmin/ListClusters + +{ + "parent": "projects/${projectId}/instances/bigtable-dep-${uniqueId}" +} + +OK + +{ + "clusters": [ + { + "defaultStorageType": "SSD", + "location": "projects/${projectId}/locations/us-west1-a", + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/clusters/cluster2-${uniqueId}", + "serveNodes": 3, + "state": "READY" + }, + { + "defaultStorageType": "SSD", + "location": "projects/${projectId}/locations/us-east1-b", + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}/clusters/cluster1-${uniqueId}", + "serveNodes": 3, + "state": "READY" + } + ] +} + +--- + +GRPC /google.bigtable.admin.v2.BigtableInstanceAdmin/DeleteInstance + +{ + "name": "projects/${projectId}/instances/bigtable-dep-${uniqueId}" +} + +OK + +{} \ No newline at end of file