I try to create a dataproc cluster via python API, I use authentification with json fle containing credentials.
app = Flask(__name__)
# Explicitly use service account credentials by specifying the private key
# file.
credentials_gcp =
service_account.Credentials.from_service_account_file('credentials.json')
client = dataproc_v1.ClusterControllerClient(credentials = credentials_gcp)
clustertest = {
"project_id": "xxxx",
"cluster_name": "testcluster",
"config": {}
}
# launch cluster on Dataproc
@app.route('/cluster/<project_id>/<region>/<clustername>', methods=['POST'])
def cluster(project_id, region, clustername):
response = client.create_cluster(project_id, 'regions/europe-west1-b',
clustertest)
response.add_done_callback(callback)
result = response.metadata()
return jsonify(result)
I get the following error
google.api_core.exceptions.PermissionDenied: 403 Permission denied on 'locations/regions/europe-west1' (or it may not exist)
I don't know if I don't have the correct rights or I have an error in the syntax