github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/python-legacy/docs/StagingApi.md (about) 1 # lakefs_client.StagingApi 2 3 All URIs are relative to *http://localhost/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) 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 * Bearer (JWT) Authentication (jwt_token): 21 * Api Key Authentication (oidc_auth): 22 * Api Key Authentication (saml_auth): 23 24 ```python 25 import time 26 import lakefs_client 27 from lakefs_client.api import staging_api 28 from lakefs_client.model.staging_location import StagingLocation 29 from lakefs_client.model.error import Error 30 from pprint import pprint 31 # Defining the host is optional and defaults to http://localhost/api/v1 32 # See configuration.py for a list of all supported configuration parameters. 33 configuration = lakefs_client.Configuration( 34 host = "http://localhost/api/v1" 35 ) 36 37 # The client must configure the authentication and authorization parameters 38 # in accordance with the API server security policy. 39 # Examples for each auth method are provided below, use the example that 40 # satisfies your auth use case. 41 42 # Configure HTTP basic authorization: basic_auth 43 configuration = lakefs_client.Configuration( 44 username = 'YOUR_USERNAME', 45 password = 'YOUR_PASSWORD' 46 ) 47 48 # Configure API key authorization: cookie_auth 49 configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' 50 51 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 52 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 53 54 # Configure Bearer authorization (JWT): jwt_token 55 configuration = lakefs_client.Configuration( 56 access_token = 'YOUR_BEARER_TOKEN' 57 ) 58 59 # Configure API key authorization: oidc_auth 60 configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' 61 62 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 63 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 64 65 # Configure API key authorization: saml_auth 66 configuration.api_key['saml_auth'] = 'YOUR_API_KEY' 67 68 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 69 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 70 71 # Enter a context with an instance of the API client 72 with lakefs_client.ApiClient(configuration) as api_client: 73 # Create an instance of the API class 74 api_instance = staging_api.StagingApi(api_client) 75 repository = "repository_example" # str | 76 branch = "branch_example" # str | 77 path = "path_example" # str | relative to the branch 78 presign = True # bool | (optional) 79 80 # example passing only required values which don't have defaults set 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) 84 pprint(api_response) 85 except lakefs_client.ApiException as e: 86 print("Exception when calling StagingApi->get_physical_address: %s\n" % e) 87 88 # example passing only required values which don't have defaults set 89 # and optional values 90 try: 91 # generate an address to which the client can upload an object 92 api_response = api_instance.get_physical_address(repository, branch, path, presign=presign) 93 pprint(api_response) 94 except lakefs_client.ApiException as e: 95 print("Exception when calling StagingApi->get_physical_address: %s\n" % e) 96 ``` 97 98 99 ### Parameters 100 101 Name | Type | Description | Notes 102 ------------- | ------------- | ------------- | ------------- 103 **repository** | **str**| | 104 **branch** | **str**| | 105 **path** | **str**| relative to the branch | 106 **presign** | **bool**| | [optional] 107 108 ### Return type 109 110 [**StagingLocation**](StagingLocation.md) 111 112 ### Authorization 113 114 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) 115 116 ### HTTP request headers 117 118 - **Content-Type**: Not defined 119 - **Accept**: application/json 120 121 122 ### HTTP response details 123 124 | Status code | Description | Response headers | 125 |-------------|-------------|------------------| 126 **200** | physical address for staging area | - | 127 **401** | Unauthorized | - | 128 **404** | Resource Not Found | - | 129 **420** | too many requests | - | 130 **0** | Internal Server Error | - | 131 132 [[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) 133 134 # **link_physical_address** 135 > ObjectStats link_physical_address(repository, branch, path, staging_metadata) 136 137 associate staging on this physical address with a path 138 139 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. 140 141 ### Example 142 143 * Basic Authentication (basic_auth): 144 * Api Key Authentication (cookie_auth): 145 * Bearer (JWT) Authentication (jwt_token): 146 * Api Key Authentication (oidc_auth): 147 * Api Key Authentication (saml_auth): 148 149 ```python 150 import time 151 import lakefs_client 152 from lakefs_client.api import staging_api 153 from lakefs_client.model.staging_location import StagingLocation 154 from lakefs_client.model.error import Error 155 from lakefs_client.model.object_stats import ObjectStats 156 from lakefs_client.model.staging_metadata import StagingMetadata 157 from pprint import pprint 158 # Defining the host is optional and defaults to http://localhost/api/v1 159 # See configuration.py for a list of all supported configuration parameters. 160 configuration = lakefs_client.Configuration( 161 host = "http://localhost/api/v1" 162 ) 163 164 # The client must configure the authentication and authorization parameters 165 # in accordance with the API server security policy. 166 # Examples for each auth method are provided below, use the example that 167 # satisfies your auth use case. 168 169 # Configure HTTP basic authorization: basic_auth 170 configuration = lakefs_client.Configuration( 171 username = 'YOUR_USERNAME', 172 password = 'YOUR_PASSWORD' 173 ) 174 175 # Configure API key authorization: cookie_auth 176 configuration.api_key['cookie_auth'] = 'YOUR_API_KEY' 177 178 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 179 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 180 181 # Configure Bearer authorization (JWT): jwt_token 182 configuration = lakefs_client.Configuration( 183 access_token = 'YOUR_BEARER_TOKEN' 184 ) 185 186 # Configure API key authorization: oidc_auth 187 configuration.api_key['oidc_auth'] = 'YOUR_API_KEY' 188 189 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 190 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 191 192 # Configure API key authorization: saml_auth 193 configuration.api_key['saml_auth'] = 'YOUR_API_KEY' 194 195 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 196 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 197 198 # Enter a context with an instance of the API client 199 with lakefs_client.ApiClient(configuration) as api_client: 200 # Create an instance of the API class 201 api_instance = staging_api.StagingApi(api_client) 202 repository = "repository_example" # str | 203 branch = "branch_example" # str | 204 path = "path_example" # str | relative to the branch 205 staging_metadata = StagingMetadata( 206 staging=StagingLocation( 207 physical_address="physical_address_example", 208 presigned_url="presigned_url_example", 209 presigned_url_expiry=1, 210 ), 211 checksum="checksum_example", 212 size_bytes=1, 213 user_metadata={ 214 "key": "key_example", 215 }, 216 content_type="content_type_example", 217 force=False, 218 ) # StagingMetadata | 219 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) 220 221 # example passing only required values which don't have defaults set 222 try: 223 # associate staging on this physical address with a path 224 api_response = api_instance.link_physical_address(repository, branch, path, staging_metadata) 225 pprint(api_response) 226 except lakefs_client.ApiException as e: 227 print("Exception when calling StagingApi->link_physical_address: %s\n" % e) 228 229 # example passing only required values which don't have defaults set 230 # and optional values 231 try: 232 # associate staging on this physical address with a path 233 api_response = api_instance.link_physical_address(repository, branch, path, staging_metadata, if_none_match=if_none_match) 234 pprint(api_response) 235 except lakefs_client.ApiException as e: 236 print("Exception when calling StagingApi->link_physical_address: %s\n" % e) 237 ``` 238 239 240 ### Parameters 241 242 Name | Type | Description | Notes 243 ------------- | ------------- | ------------- | ------------- 244 **repository** | **str**| | 245 **branch** | **str**| | 246 **path** | **str**| relative to the branch | 247 **staging_metadata** | [**StagingMetadata**](StagingMetadata.md)| | 248 **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] 249 250 ### Return type 251 252 [**ObjectStats**](ObjectStats.md) 253 254 ### Authorization 255 256 [basic_auth](../README.md#basic_auth), [cookie_auth](../README.md#cookie_auth), [jwt_token](../README.md#jwt_token), [oidc_auth](../README.md#oidc_auth), [saml_auth](../README.md#saml_auth) 257 258 ### HTTP request headers 259 260 - **Content-Type**: application/json 261 - **Accept**: application/json 262 263 264 ### HTTP response details 265 266 | Status code | Description | Response headers | 267 |-------------|-------------|------------------| 268 **200** | object metadata | - | 269 **400** | Validation Error | - | 270 **401** | Unauthorized | - | 271 **403** | Forbidden | - | 272 **404** | Internal Server Error | - | 273 **409** | conflict with a commit, try here | - | 274 **412** | Precondition Failed | - | 275 **420** | too many requests | - | 276 **0** | Internal Server Error | - | 277 278 [[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) 279