Comments (7)
@mholleville Thanks for the report. This is due to a strangeness in the proto file for the Cluster service, which deprecates the three original atttributes of the ListNodePoolsRequest
message (project_id
, zone
, cluster_id
) and makes the fourth one (parent
) required.
As a workaround, you can pass None
for the three deprecated arguments, e.g.:
parent = '/projects/{}/locations/{}/clusters/{}'.format(project_id, zone, cluster_id)
pool_iter = client.list_node_pools(parent=parent, project_id=None, zone=None, cluster_id=None)
for pool in pool_iter:
do_something_with(pool)
@lukesneeringer I don't understand how that is supposed to work, but it definitely trips up our code generator: we generated the deprecated fields as required positional arguments! This issue actually infects pretty much every method of the Python container client.
from python-container.
Trying but google.api_core.exceptions.InvalidArgument: 400 Location "locations" does not exist.
:(
from python-container.
The location should probably be either global
or a specific location (e.g. us-central-1
).
from python-container.
@noahdietz, can you recommend a way forward? It looks like the GAPIC YAML file is b0rked.
from python-container.
A little bird says maybe I should ask @dazuma instead for help here.
from python-container.
@mholleville - I think there might have been a typo in the comment above (slash before projects
), this works for me with both a regional and zonal cluster:
parent = 'projects/{}/locations/{}/clusters/{}'.format(project_id, location, cluster_id)
print (client.list_node_pools(parent=parent, project_id=None, zone=None, cluster_id=None))
from python-container.
@mholleville - I think there might have been a typo in the comment above (slash before
projects
), this works for me with both a regional and zonal cluster:parent = 'projects/{}/locations/{}/clusters/{}'.format(project_id, location, cluster_id) print (client.list_node_pools(parent=parent, project_id=None, zone=None, cluster_id=None))
Following up on this issue - dijitali@'s example is working for me, google_cloud_container 2.4.0
, with us-central1
set as the location
--
from google.cloud.container_v1.services.cluster_manager import ClusterManagerClient
from google.cloud.container_v1.types import cluster_service
import google.auth
credentials, project_id = google.auth.default()
location = "us-central1"
cluster_id="regional-cluster"
client = ClusterManagerClient(credentials=credentials)
parent = 'projects/{}/locations/{}/clusters/{}'.format(project_id, location, cluster_id)
print (client.list_node_pools(parent=parent, project_id=None, zone=None, cluster_id=None))
Output:
node_pools {
name: "default-pool"
config {
machine_type: "e2-medium"
...
Closing this issue given that there's a suitable workaround for the deprecated fields.
from python-container.
Related Issues (20)
- Warning: a recent release failed
- GKE clusters not cleaning up after create cluster test HOT 1
- Warning: a recent release failed HOT 1
- tests.unit.gapic.container_v1.test_cluster_manager: test_list_usable_subnetworks_pager failed
- tests.unit.gapic.container_v1.test_cluster_manager: test_list_usable_subnetworks_pager failed HOT 2
- tests.unit.gapic.container_v1.test_cluster_manager: test_list_usable_subnetworks_async_pager failed HOT 2
- tests.unit.gapic.container_v1.test_cluster_manager: test_list_usable_subnetworks_async_pager failed HOT 1
- tests.unit.gapic.container_v1beta1.test_cluster_manager: test_set_labels_flattened failed HOT 1
- tests.unit.gapic.container_v1beta1.test_cluster_manager: test_set_labels_flattened failed HOT 1
- tests.unit.gapic.container_v1beta1.test_cluster_manager: test_set_labels_flattened_async failed HOT 1
- tests.unit.gapic.container_v1beta1.test_cluster_manager: test_set_labels_flattened_async failed HOT 1
- tests.unit.gapic.container_v1beta1.test_cluster_manager: test_list_usable_subnetworks_pager failed HOT 1
- tests.unit.gapic.container_v1beta1.test_cluster_manager: test_list_usable_subnetworks_pager failed HOT 1
- tests.unit.gapic.container_v1beta1.test_cluster_manager: test_list_usable_subnetworks_async_pager failed HOT 2
- tests.unit.gapic.container_v1beta1.test_cluster_manager: test_list_usable_subnetworks_async_pager failed HOT 1
- Unable to import module 'index': cannot import name 'cygrpc' from 'grpc._cython' HOT 3
- Warning: a recent release failed HOT 1
- `AttributeError` when trying to update the insecure kubelet port HOT 1
- Are there any real examples instead of just copy pasting the api docs as files? HOT 2
- Values for `name` field are supplied inconsistently across different types HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-container.