github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/python/docs/StagingApi.md (about) 1 # lakefs_sdk.StagingApi 2 3 All URIs are relative to */api/v1* 4 5 Method | HTTP request | Description 6 ------------- | ------------- | ------------- 7 [**get_physical_address**](StagingApi.md#get_physical_address) | **GET** /repositories/{repository}/branches/{branch}/staging/backing | generate an address to which the client can upload an object 8 [**link_physical_address**](StagingApi.md#link_physical_address) | **PUT** /repositories/{repository}/branches/{branch}/staging/backing | associate staging on this physical address with a path 9 10 11 # **get_physical_address** 12 > StagingLocation get_physical_address(repository, branch, path, presign=presign) 13 14 generate an address to which the client can upload an object 15 16 ### Example 17 18 * Basic Authentication (basic_auth): 19 * Api Key Authentication (cookie_auth): 20 * Api Key Authentication (oidc_auth): 21 * Api Key Authentication (saml_auth): 22 * Bearer (JWT) Authentication (jwt_token): 23 24 ```python 25 import time 26 import os 27 import lakefs_sdk 28 from lakefs_sdk.models.staging_location import StagingLocation 29 from lakefs_sdk.rest import ApiException 30 from pprint import pprint 31 32 # Defining the host is optional and defaults to /api/v1 33 # See configuration.py for a list of all supported configuration parameters. 34 configuration = lakefs_sdk.Configuration( 35 host = "/api/v1" 36 ) 37 38 # The client must configure the authentication and authorization parameters 39 # in accordance with the API server security policy. 40 # Examples for each auth method are provided below, use the example that 41 # satisfies your auth use case. 42 43 # Configure HTTP basic authorization: basic_auth 44 configuration = lakefs_sdk.Configuration( 45 username = os.environ["USERNAME"], 46 password = os.environ["PASSWORD"] 47 ) 48 49 # Configure API key authorization: cookie_auth 50 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 51 52 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 53 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 54 55 # Configure API key authorization: oidc_auth 56 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 57 58 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 59 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 60 61 # Configure API key authorization: saml_auth 62 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 63 64 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 65 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 66 67 # Configure Bearer authorization (JWT): jwt_token 68 configuration = lakefs_sdk.Configuration( 69 access_token = os.environ["BEARER_TOKEN"] 70 ) 71 72 # Enter a context with an instance of the API client 73 with lakefs_sdk.ApiClient(configuration) as api_client: 74 # Create an instance of the API class 75 api_instance = lakefs_sdk.StagingApi(api_client) 76 repository = 'repository_example' # str | 77 branch = 'branch_example' # str | 78 path = 'path_example' # str | relative to the branch 79 presign = True # bool | (optional) 80 81 try: 82 # generate an address to which the client can upload an object 83 api_response = api_instance.get_physical_address(repository, branch, path, presign=presign) 84 print("The response of StagingApi->get_physical_address:\n") 85 pprint(api_response) 86 except Exception as e: 87 print("Exception when calling StagingApi->get_physical_address: %s\n" % e) 88 ``` 89 90 91 92 ### Parameters 93 94 95 Name | Type | Description | Notes 96 ------------- | ------------- | ------------- | ------------- 97 **repository** | **str**| | 98 **branch** | **str**| | 99 **path** | **str**| relative to the branch | 100 **presign** | **bool**| | [optional] 101 102 ### Return type 103 104 [**StagingLocation**](StagingLocation.md) 105 106 ### Authorization 107 108 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) 109 110 ### HTTP request headers 111 112 - **Content-Type**: Not defined 113 - **Accept**: application/json 114 115 ### HTTP response details 116 117 | Status code | Description | Response headers | 118 |-------------|-------------|------------------| 119 **200** | physical address for staging area | - | 120 **401** | Unauthorized | - | 121 **404** | Resource Not Found | - | 122 **420** | too many requests | - | 123 **0** | Internal Server Error | - | 124 125 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 126 127 # **link_physical_address** 128 > ObjectStats link_physical_address(repository, branch, path, staging_metadata, if_none_match=if_none_match) 129 130 associate staging on this physical address with a path 131 132 Link the physical address with the path in lakeFS, creating an uncommitted change. The given address can be one generated by getPhysicalAddress, or an address outside the repository's storage namespace. 133 134 ### Example 135 136 * Basic Authentication (basic_auth): 137 * Api Key Authentication (cookie_auth): 138 * Api Key Authentication (oidc_auth): 139 * Api Key Authentication (saml_auth): 140 * Bearer (JWT) Authentication (jwt_token): 141 142 ```python 143 import time 144 import os 145 import lakefs_sdk 146 from lakefs_sdk.models.object_stats import ObjectStats 147 from lakefs_sdk.models.staging_metadata import StagingMetadata 148 from lakefs_sdk.rest import ApiException 149 from pprint import pprint 150 151 # Defining the host is optional and defaults to /api/v1 152 # See configuration.py for a list of all supported configuration parameters. 153 configuration = lakefs_sdk.Configuration( 154 host = "/api/v1" 155 ) 156 157 # The client must configure the authentication and authorization parameters 158 # in accordance with the API server security policy. 159 # Examples for each auth method are provided below, use the example that 160 # satisfies your auth use case. 161 162 # Configure HTTP basic authorization: basic_auth 163 configuration = lakefs_sdk.Configuration( 164 username = os.environ["USERNAME"], 165 password = os.environ["PASSWORD"] 166 ) 167 168 # Configure API key authorization: cookie_auth 169 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 170 171 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 172 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 173 174 # Configure API key authorization: oidc_auth 175 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 176 177 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 178 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 179 180 # Configure API key authorization: saml_auth 181 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 182 183 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 184 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 185 186 # Configure Bearer authorization (JWT): jwt_token 187 configuration = lakefs_sdk.Configuration( 188 access_token = os.environ["BEARER_TOKEN"] 189 ) 190 191 # Enter a context with an instance of the API client 192 with lakefs_sdk.ApiClient(configuration) as api_client: 193 # Create an instance of the API class 194 api_instance = lakefs_sdk.StagingApi(api_client) 195 repository = 'repository_example' # str | 196 branch = 'branch_example' # str | 197 path = 'path_example' # str | relative to the branch 198 staging_metadata = lakefs_sdk.StagingMetadata() # StagingMetadata | 199 if_none_match = '*' # str | Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported. (optional) 200 201 try: 202 # associate staging on this physical address with a path 203 api_response = api_instance.link_physical_address(repository, branch, path, staging_metadata, if_none_match=if_none_match) 204 print("The response of StagingApi->link_physical_address:\n") 205 pprint(api_response) 206 except Exception as e: 207 print("Exception when calling StagingApi->link_physical_address: %s\n" % e) 208 ``` 209 210 211 212 ### Parameters 213 214 215 Name | Type | Description | Notes 216 ------------- | ------------- | ------------- | ------------- 217 **repository** | **str**| | 218 **branch** | **str**| | 219 **path** | **str**| relative to the branch | 220 **staging_metadata** | [**StagingMetadata**](StagingMetadata.md)| | 221 **if_none_match** | **str**| Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported. | [optional] 222 223 ### Return type 224 225 [**ObjectStats**](ObjectStats.md) 226 227 ### Authorization 228 229 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth), [jwt_token](../README.md#jwt_token) 230 231 ### HTTP request headers 232 233 - **Content-Type**: application/json 234 - **Accept**: application/json 235 236 ### HTTP response details 237 238 | Status code | Description | Response headers | 239 |-------------|-------------|------------------| 240 **200** | object metadata | - | 241 **400** | Validation Error | - | 242 **401** | Unauthorized | - | 243 **403** | Forbidden | - | 244 **404** | Internal Server Error | - | 245 **409** | conflict with a commit, try here | - | 246 **412** | Precondition Failed | - | 247 **420** | too many requests | - | 248 **0** | Internal Server Error | - | 249 250 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 251