Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

fix: proper http bindings for v2 API #209

Merged
merged 9 commits into from
Jan 25, 2023
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ branch = True
show_missing = True
omit =
google/cloud/tpu/__init__.py
google/cloud/tpu/gapic_version.py
exclude_lines =
# Re-enable the standard pragma
pragma: NO COVER
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/tpu_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.cloud.tpu import gapic_version as package_version
from google.cloud.tpu_v1 import gapic_version as package_version

__version__ = package_version.__version__

Expand Down
2 changes: 1 addition & 1 deletion google/cloud/tpu_v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.cloud.tpu import gapic_version as package_version
from google.cloud.tpu_v2 import gapic_version as package_version

__version__ = package_version.__version__

Expand Down
120 changes: 0 additions & 120 deletions google/cloud/tpu_v2/services/tpu/transports/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,72 +714,24 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient:
if self._operations_client is None:
http_options: Dict[str, List[Dict[str, str]]] = {
"google.longrunning.Operations.CancelOperation": [
{
"method": "post",
"uri": "/v1alpha1/{name=projects/*/locations/*/operations/*}:cancel",
},
{
"method": "post",
"uri": "/v1/{name=projects/*/locations/*/operations/*}:cancel",
},
{
"method": "post",
"uri": "/v2alpha1/{name=projects/*/locations/*/operations/*}:cancel",
},
{
"method": "post",
"uri": "/v2/{name=projects/*/locations/*/operations/*}:cancel",
},
],
"google.longrunning.Operations.DeleteOperation": [
{
"method": "delete",
"uri": "/v1alpha1/{name=projects/*/locations/*/operations/*}",
},
{
"method": "delete",
"uri": "/v1/{name=projects/*/locations/*/operations/*}",
},
{
"method": "delete",
"uri": "/v2alpha1/{name=projects/*/locations/*/operations/*}",
},
{
"method": "delete",
"uri": "/v2/{name=projects/*/locations/*/operations/*}",
},
],
"google.longrunning.Operations.GetOperation": [
{
"method": "get",
"uri": "/v1alpha1/{name=projects/*/locations/*/operations/*}",
},
{
"method": "get",
"uri": "/v1/{name=projects/*/locations/*/operations/*}",
},
{
"method": "get",
"uri": "/v2alpha1/{name=projects/*/locations/*/operations/*}",
},
{
"method": "get",
"uri": "/v2/{name=projects/*/locations/*/operations/*}",
},
],
"google.longrunning.Operations.ListOperations": [
{
"method": "get",
"uri": "/v1alpha1/{name=projects/*/locations/*}/operations",
},
{
"method": "get",
"uri": "/v1/{name=projects/*/locations/*}/operations",
},
{
"method": "get",
"uri": "/v2alpha1/{name=projects/*/locations/*}/operations",
},
{
"method": "get",
"uri": "/v2/{name=projects/*/locations/*}/operations",
Expand Down Expand Up @@ -2173,18 +2125,6 @@ def __call__(
"""

http_options: List[Dict[str, str]] = [
{
"method": "get",
"uri": "/v1alpha1/{name=projects/*/locations/*}",
},
{
"method": "get",
"uri": "/v1/{name=projects/*/locations/*}",
},
{
"method": "get",
"uri": "/v2alpha1/{name=projects/*/locations/*}",
},
{
"method": "get",
"uri": "/v2/{name=projects/*/locations/*}",
Expand Down Expand Up @@ -2252,18 +2192,6 @@ def __call__(
"""

http_options: List[Dict[str, str]] = [
{
"method": "get",
"uri": "/v1alpha1/{name=projects/*}/locations",
},
{
"method": "get",
"uri": "/v1/{name=projects/*}/locations",
},
{
"method": "get",
"uri": "/v2alpha1/{name=projects/*}/locations",
},
{
"method": "get",
"uri": "/v2/{name=projects/*}/locations",
Expand Down Expand Up @@ -2328,18 +2256,6 @@ def __call__(
"""

http_options: List[Dict[str, str]] = [
{
"method": "post",
"uri": "/v1alpha1/{name=projects/*/locations/*/operations/*}:cancel",
},
{
"method": "post",
"uri": "/v1/{name=projects/*/locations/*/operations/*}:cancel",
},
{
"method": "post",
"uri": "/v2alpha1/{name=projects/*/locations/*/operations/*}:cancel",
},
{
"method": "post",
"uri": "/v2/{name=projects/*/locations/*/operations/*}:cancel",
Expand Down Expand Up @@ -2403,18 +2319,6 @@ def __call__(
"""

http_options: List[Dict[str, str]] = [
{
"method": "delete",
"uri": "/v1alpha1/{name=projects/*/locations/*/operations/*}",
},
{
"method": "delete",
"uri": "/v1/{name=projects/*/locations/*/operations/*}",
},
{
"method": "delete",
"uri": "/v2alpha1/{name=projects/*/locations/*/operations/*}",
},
{
"method": "delete",
"uri": "/v2/{name=projects/*/locations/*/operations/*}",
Expand Down Expand Up @@ -2481,18 +2385,6 @@ def __call__(
"""

http_options: List[Dict[str, str]] = [
{
"method": "get",
"uri": "/v1alpha1/{name=projects/*/locations/*/operations/*}",
},
{
"method": "get",
"uri": "/v1/{name=projects/*/locations/*/operations/*}",
},
{
"method": "get",
"uri": "/v2alpha1/{name=projects/*/locations/*/operations/*}",
},
{
"method": "get",
"uri": "/v2/{name=projects/*/locations/*/operations/*}",
Expand Down Expand Up @@ -2560,18 +2452,6 @@ def __call__(
"""

http_options: List[Dict[str, str]] = [
{
"method": "get",
"uri": "/v1alpha1/{name=projects/*/locations/*}/operations",
},
{
"method": "get",
"uri": "/v1/{name=projects/*/locations/*}/operations",
},
{
"method": "get",
"uri": "/v2alpha1/{name=projects/*/locations/*}/operations",
},
{
"method": "get",
"uri": "/v2/{name=projects/*/locations/*}/operations",
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/tpu_v2alpha1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.cloud.tpu import gapic_version as package_version
from google.cloud.tpu_v2alpha1 import gapic_version as package_version

__version__ = package_version.__version__

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-tpu",
"version": "1.7.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-tpu",
"version": "1.7.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-tpu",
"version": "1.7.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down