airflow_client.client.VariableApi

All URIs are relative to http://localhost

MethodHTTP requestDescription
bulk_variablesPATCH /api/v2/variablesBulk Variables
delete_variableDELETE /api/v2/variables/{variable_key}Delete Variable
get_variableGET /api/v2/variables/{variable_key}Get Variable
get_variablesGET /api/v2/variablesGet Variables
patch_variablePATCH /api/v2/variables/{variable_key}Patch Variable
post_variablePOST /api/v2/variablesPost Variable

bulk_variables

BulkResponse bulk_variables(bulk_body_variable_body)

Bulk Variables

Bulk create, update, and delete variables.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.models.bulk_body_variable_body import BulkBodyVariableBody
from airflow_client.client.models.bulk_response import BulkResponse
from airflow_client.client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = airflow_client.client.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure Bearer authorization: HTTPBearer
configuration = airflow_client.client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with airflow_client.client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = airflow_client.client.VariableApi(api_client)
    bulk_body_variable_body = airflow_client.client.BulkBodyVariableBody() # BulkBodyVariableBody | 

    try:
        # Bulk Variables
        api_response = api_instance.bulk_variables(bulk_body_variable_body)
        print("The response of VariableApi->bulk_variables:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VariableApi->bulk_variables: %s\n" % e)

Parameters

NameTypeDescriptionNotes
bulk_body_variable_bodyBulkBodyVariableBody

Return type

BulkResponse

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successful Response-
401Unauthorized-
403Forbidden-
422Validation Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_variable

delete_variable(variable_key)

Delete Variable

Delete a variable entry.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = airflow_client.client.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure Bearer authorization: HTTPBearer
configuration = airflow_client.client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with airflow_client.client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = airflow_client.client.VariableApi(api_client)
    variable_key = 'variable_key_example' # str | 

    try:
        # Delete Variable
        api_instance.delete_variable(variable_key)
    except Exception as e:
        print("Exception when calling VariableApi->delete_variable: %s\n" % e)

Parameters

NameTypeDescriptionNotes
variable_keystr

Return type

void (empty response body)

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
204Successful Response-
401Unauthorized-
403Forbidden-
404Not Found-
422Validation Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_variable

VariableResponse get_variable(variable_key)

Get Variable

Get a variable entry.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.models.variable_response import VariableResponse
from airflow_client.client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = airflow_client.client.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure Bearer authorization: HTTPBearer
configuration = airflow_client.client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with airflow_client.client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = airflow_client.client.VariableApi(api_client)
    variable_key = 'variable_key_example' # str | 

    try:
        # Get Variable
        api_response = api_instance.get_variable(variable_key)
        print("The response of VariableApi->get_variable:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VariableApi->get_variable: %s\n" % e)

Parameters

NameTypeDescriptionNotes
variable_keystr

Return type

VariableResponse

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successful Response-
401Unauthorized-
403Forbidden-
404Not Found-
422Validation Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_variables

VariableCollectionResponse get_variables(limit=limit, offset=offset, order_by=order_by, variable_key_pattern=variable_key_pattern)

Get Variables

Get all Variables entries.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.models.variable_collection_response import VariableCollectionResponse
from airflow_client.client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = airflow_client.client.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure Bearer authorization: HTTPBearer
configuration = airflow_client.client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with airflow_client.client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = airflow_client.client.VariableApi(api_client)
    limit = 50 # int |  (optional) (default to 50)
    offset = 0 # int |  (optional) (default to 0)
    order_by = [id] # List[str] |  (optional) (default to [id])
    variable_key_pattern = 'variable_key_pattern_example' # str | SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported. (optional)

    try:
        # Get Variables
        api_response = api_instance.get_variables(limit=limit, offset=offset, order_by=order_by, variable_key_pattern=variable_key_pattern)
        print("The response of VariableApi->get_variables:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VariableApi->get_variables: %s\n" % e)

Parameters

NameTypeDescriptionNotes
limitint[optional] [default to 50]
offsetint[optional] [default to 0]
order_byList[str][optional] [default to [id]]
variable_key_patternstrSQL LIKE expression — use `%` / `` wildcards (e.g. `%customer%`). Regular expressions are not supported.[optional]

Return type

VariableCollectionResponse

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successful Response-
401Unauthorized-
403Forbidden-
422Validation Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

patch_variable

VariableResponse patch_variable(variable_key, variable_body, update_mask=update_mask)

Patch Variable

Update a variable by key.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.models.variable_body import VariableBody
from airflow_client.client.models.variable_response import VariableResponse
from airflow_client.client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = airflow_client.client.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure Bearer authorization: HTTPBearer
configuration = airflow_client.client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with airflow_client.client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = airflow_client.client.VariableApi(api_client)
    variable_key = 'variable_key_example' # str | 
    variable_body = airflow_client.client.VariableBody() # VariableBody | 
    update_mask = ['update_mask_example'] # List[str] |  (optional)

    try:
        # Patch Variable
        api_response = api_instance.patch_variable(variable_key, variable_body, update_mask=update_mask)
        print("The response of VariableApi->patch_variable:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VariableApi->patch_variable: %s\n" % e)

Parameters

NameTypeDescriptionNotes
variable_keystr
variable_bodyVariableBody
update_maskList[str][optional]

Return type

VariableResponse

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successful Response-
400Bad Request-
401Unauthorized-
403Forbidden-
404Not Found-
422Validation Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

post_variable

VariableResponse post_variable(variable_body)

Post Variable

Create a variable.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.models.variable_body import VariableBody
from airflow_client.client.models.variable_response import VariableResponse
from airflow_client.client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = airflow_client.client.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure Bearer authorization: HTTPBearer
configuration = airflow_client.client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with airflow_client.client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = airflow_client.client.VariableApi(api_client)
    variable_body = airflow_client.client.VariableBody() # VariableBody | 

    try:
        # Post Variable
        api_response = api_instance.post_variable(variable_body)
        print("The response of VariableApi->post_variable:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling VariableApi->post_variable: %s\n" % e)

Parameters

NameTypeDescriptionNotes
variable_bodyVariableBody

Return type

VariableResponse

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
201Successful Response-
401Unauthorized-
403Forbidden-
409Conflict-
422Validation Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]