22from ..graphql import graphql_client
33
44
5- def create_deployment (name , project_id , spec , cluster_id = None ):
6- client = graphql_client ()
5+ def create_deployment (name , project_id , spec , cluster_id = None , api_key = None ):
6+ client = graphql_client (api_key )
77 query = gql (
88 """
99 mutation createDeployment($input: CreateDeploymentInput!) {
@@ -26,8 +26,8 @@ def create_deployment(name, project_id, spec, cluster_id=None):
2626 return client .execute (query , variable_values = params )['createDeployment' ]['deployment' ]
2727
2828
29- def update_deployment (id , name = None , project_id = None , spec = None , cluster_id = None ):
30- client = graphql_client ()
29+ def update_deployment (id , name = None , project_id = None , spec = None , cluster_id = None , api_key = None ):
30+ client = graphql_client (api_key )
3131 query = gql (
3232 """
3333 mutation updateDeployment($input: UpdateDeploymentInput!) {
@@ -58,8 +58,8 @@ def update_deployment(id, name=None, project_id=None, spec=None, cluster_id=None
5858 return client .execute (query , variable_values = params )['updateDeployment' ]['deployment' ]
5959
6060
61- def get_deployment (id , first = 100 ):
62- client = graphql_client ()
61+ def get_deployment (id , first = 100 , api_key = None ):
62+ client = graphql_client (api_key )
6363 query = gql (
6464 """
6565 query getDeployment($id: UUID!, $first: Int!) {
@@ -130,8 +130,8 @@ def get_deployment(id, first=100):
130130 return client .execute (query , variable_values = params )
131131
132132
133- def list_deployments (first = 100 ):
134- client = graphql_client ()
133+ def list_deployments (first = 100 , api_key = None ):
134+ client = graphql_client (api_key )
135135 query = gql (
136136 """
137137 query getDeployments($first: Int!) {
@@ -184,8 +184,8 @@ def list_deployments(first=100):
184184 return client .execute (query , variable_values = params )['deployments' ]['nodes' ]
185185
186186
187- def delete_deployment (id ):
188- client = graphql_client ()
187+ def delete_deployment (id , api_key = None ):
188+ client = graphql_client (api_key )
189189 query = gql (
190190 """
191191 mutation deleteDeployment($input: DeleteDeploymentInput!) {
0 commit comments