github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/python/docs/RepositoriesApi.md (about) 1 # lakefs_sdk.RepositoriesApi 2 3 All URIs are relative to */api/v1* 4 5 Method | HTTP request | Description 6 ------------- | ------------- | ------------- 7 [**create_repository**](RepositoriesApi.md#create_repository) | **POST** /repositories | create repository 8 [**delete_gc_rules**](RepositoriesApi.md#delete_gc_rules) | **DELETE** /repositories/{repository}/settings/gc_rules | 9 [**delete_repository**](RepositoriesApi.md#delete_repository) | **DELETE** /repositories/{repository} | delete repository 10 [**dump_status**](RepositoriesApi.md#dump_status) | **GET** /repositories/{repository}/dump | Status of a repository dump task 11 [**dump_submit**](RepositoriesApi.md#dump_submit) | **POST** /repositories/{repository}/dump | Backup the repository metadata (tags, commits, branches) and save the backup to the object store. 12 [**get_branch_protection_rules**](RepositoriesApi.md#get_branch_protection_rules) | **GET** /repositories/{repository}/settings/branch_protection | get branch protection rules 13 [**get_gc_rules**](RepositoriesApi.md#get_gc_rules) | **GET** /repositories/{repository}/settings/gc_rules | get repository GC rules 14 [**get_repository**](RepositoriesApi.md#get_repository) | **GET** /repositories/{repository} | get repository 15 [**get_repository_metadata**](RepositoriesApi.md#get_repository_metadata) | **GET** /repositories/{repository}/metadata | get repository metadata 16 [**list_repositories**](RepositoriesApi.md#list_repositories) | **GET** /repositories | list repositories 17 [**restore_status**](RepositoriesApi.md#restore_status) | **GET** /repositories/{repository}/restore | Status of a restore request 18 [**restore_submit**](RepositoriesApi.md#restore_submit) | **POST** /repositories/{repository}/restore | Restore repository from a dump in the object store 19 [**set_branch_protection_rules**](RepositoriesApi.md#set_branch_protection_rules) | **PUT** /repositories/{repository}/settings/branch_protection | 20 [**set_gc_rules**](RepositoriesApi.md#set_gc_rules) | **PUT** /repositories/{repository}/settings/gc_rules | 21 22 23 # **create_repository** 24 > Repository create_repository(repository_creation, bare=bare) 25 26 create repository 27 28 ### Example 29 30 * Basic Authentication (basic_auth): 31 * Api Key Authentication (cookie_auth): 32 * Api Key Authentication (oidc_auth): 33 * Api Key Authentication (saml_auth): 34 * Bearer (JWT) Authentication (jwt_token): 35 36 ```python 37 import time 38 import os 39 import lakefs_sdk 40 from lakefs_sdk.models.repository import Repository 41 from lakefs_sdk.models.repository_creation import RepositoryCreation 42 from lakefs_sdk.rest import ApiException 43 from pprint import pprint 44 45 # Defining the host is optional and defaults to /api/v1 46 # See configuration.py for a list of all supported configuration parameters. 47 configuration = lakefs_sdk.Configuration( 48 host = "/api/v1" 49 ) 50 51 # The client must configure the authentication and authorization parameters 52 # in accordance with the API server security policy. 53 # Examples for each auth method are provided below, use the example that 54 # satisfies your auth use case. 55 56 # Configure HTTP basic authorization: basic_auth 57 configuration = lakefs_sdk.Configuration( 58 username = os.environ["USERNAME"], 59 password = os.environ["PASSWORD"] 60 ) 61 62 # Configure API key authorization: cookie_auth 63 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 64 65 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 66 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 67 68 # Configure API key authorization: oidc_auth 69 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 70 71 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 72 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 73 74 # Configure API key authorization: saml_auth 75 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 76 77 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 78 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 79 80 # Configure Bearer authorization (JWT): jwt_token 81 configuration = lakefs_sdk.Configuration( 82 access_token = os.environ["BEARER_TOKEN"] 83 ) 84 85 # Enter a context with an instance of the API client 86 with lakefs_sdk.ApiClient(configuration) as api_client: 87 # Create an instance of the API class 88 api_instance = lakefs_sdk.RepositoriesApi(api_client) 89 repository_creation = lakefs_sdk.RepositoryCreation() # RepositoryCreation | 90 bare = False # bool | If true, create a bare repository with no initial commit and branch (optional) (default to False) 91 92 try: 93 # create repository 94 api_response = api_instance.create_repository(repository_creation, bare=bare) 95 print("The response of RepositoriesApi->create_repository:\n") 96 pprint(api_response) 97 except Exception as e: 98 print("Exception when calling RepositoriesApi->create_repository: %s\n" % e) 99 ``` 100 101 102 103 ### Parameters 104 105 106 Name | Type | Description | Notes 107 ------------- | ------------- | ------------- | ------------- 108 **repository_creation** | [**RepositoryCreation**](RepositoryCreation.md)| | 109 **bare** | **bool**| If true, create a bare repository with no initial commit and branch | [optional] [default to False] 110 111 ### Return type 112 113 [**Repository**](Repository.md) 114 115 ### Authorization 116 117 [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) 118 119 ### HTTP request headers 120 121 - **Content-Type**: application/json 122 - **Accept**: application/json 123 124 ### HTTP response details 125 126 | Status code | Description | Response headers | 127 |-------------|-------------|------------------| 128 **201** | repository | - | 129 **400** | Validation Error | - | 130 **401** | Unauthorized | - | 131 **409** | Resource Conflicts With Target | - | 132 **420** | too many requests | - | 133 **0** | Internal Server Error | - | 134 135 [[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) 136 137 # **delete_gc_rules** 138 > delete_gc_rules(repository) 139 140 141 142 ### Example 143 144 * Basic Authentication (basic_auth): 145 * Api Key Authentication (cookie_auth): 146 * Api Key Authentication (oidc_auth): 147 * Api Key Authentication (saml_auth): 148 * Bearer (JWT) Authentication (jwt_token): 149 150 ```python 151 import time 152 import os 153 import lakefs_sdk 154 from lakefs_sdk.rest import ApiException 155 from pprint import pprint 156 157 # Defining the host is optional and defaults to /api/v1 158 # See configuration.py for a list of all supported configuration parameters. 159 configuration = lakefs_sdk.Configuration( 160 host = "/api/v1" 161 ) 162 163 # The client must configure the authentication and authorization parameters 164 # in accordance with the API server security policy. 165 # Examples for each auth method are provided below, use the example that 166 # satisfies your auth use case. 167 168 # Configure HTTP basic authorization: basic_auth 169 configuration = lakefs_sdk.Configuration( 170 username = os.environ["USERNAME"], 171 password = os.environ["PASSWORD"] 172 ) 173 174 # Configure API key authorization: cookie_auth 175 configuration.api_key['cookie_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['cookie_auth'] = 'Bearer' 179 180 # Configure API key authorization: oidc_auth 181 configuration.api_key['oidc_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['oidc_auth'] = 'Bearer' 185 186 # Configure API key authorization: saml_auth 187 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 188 189 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 190 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 191 192 # Configure Bearer authorization (JWT): jwt_token 193 configuration = lakefs_sdk.Configuration( 194 access_token = os.environ["BEARER_TOKEN"] 195 ) 196 197 # Enter a context with an instance of the API client 198 with lakefs_sdk.ApiClient(configuration) as api_client: 199 # Create an instance of the API class 200 api_instance = lakefs_sdk.RepositoriesApi(api_client) 201 repository = 'repository_example' # str | 202 203 try: 204 api_instance.delete_gc_rules(repository) 205 except Exception as e: 206 print("Exception when calling RepositoriesApi->delete_gc_rules: %s\n" % e) 207 ``` 208 209 210 211 ### Parameters 212 213 214 Name | Type | Description | Notes 215 ------------- | ------------- | ------------- | ------------- 216 **repository** | **str**| | 217 218 ### Return type 219 220 void (empty response body) 221 222 ### Authorization 223 224 [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) 225 226 ### HTTP request headers 227 228 - **Content-Type**: Not defined 229 - **Accept**: application/json 230 231 ### HTTP response details 232 233 | Status code | Description | Response headers | 234 |-------------|-------------|------------------| 235 **204** | deleted garbage collection rules successfully | - | 236 **401** | Unauthorized | - | 237 **403** | Forbidden | - | 238 **404** | Resource Not Found | - | 239 **420** | too many requests | - | 240 **0** | Internal Server Error | - | 241 242 [[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) 243 244 # **delete_repository** 245 > delete_repository(repository, force=force) 246 247 delete repository 248 249 ### Example 250 251 * Basic Authentication (basic_auth): 252 * Api Key Authentication (cookie_auth): 253 * Api Key Authentication (oidc_auth): 254 * Api Key Authentication (saml_auth): 255 * Bearer (JWT) Authentication (jwt_token): 256 257 ```python 258 import time 259 import os 260 import lakefs_sdk 261 from lakefs_sdk.rest import ApiException 262 from pprint import pprint 263 264 # Defining the host is optional and defaults to /api/v1 265 # See configuration.py for a list of all supported configuration parameters. 266 configuration = lakefs_sdk.Configuration( 267 host = "/api/v1" 268 ) 269 270 # The client must configure the authentication and authorization parameters 271 # in accordance with the API server security policy. 272 # Examples for each auth method are provided below, use the example that 273 # satisfies your auth use case. 274 275 # Configure HTTP basic authorization: basic_auth 276 configuration = lakefs_sdk.Configuration( 277 username = os.environ["USERNAME"], 278 password = os.environ["PASSWORD"] 279 ) 280 281 # Configure API key authorization: cookie_auth 282 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 283 284 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 285 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 286 287 # Configure API key authorization: oidc_auth 288 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 289 290 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 291 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 292 293 # Configure API key authorization: saml_auth 294 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 295 296 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 297 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 298 299 # Configure Bearer authorization (JWT): jwt_token 300 configuration = lakefs_sdk.Configuration( 301 access_token = os.environ["BEARER_TOKEN"] 302 ) 303 304 # Enter a context with an instance of the API client 305 with lakefs_sdk.ApiClient(configuration) as api_client: 306 # Create an instance of the API class 307 api_instance = lakefs_sdk.RepositoriesApi(api_client) 308 repository = 'repository_example' # str | 309 force = False # bool | Bypass read-only protection and delete the repository (optional) (default to False) 310 311 try: 312 # delete repository 313 api_instance.delete_repository(repository, force=force) 314 except Exception as e: 315 print("Exception when calling RepositoriesApi->delete_repository: %s\n" % e) 316 ``` 317 318 319 320 ### Parameters 321 322 323 Name | Type | Description | Notes 324 ------------- | ------------- | ------------- | ------------- 325 **repository** | **str**| | 326 **force** | **bool**| Bypass read-only protection and delete the repository | [optional] [default to False] 327 328 ### Return type 329 330 void (empty response body) 331 332 ### Authorization 333 334 [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) 335 336 ### HTTP request headers 337 338 - **Content-Type**: Not defined 339 - **Accept**: application/json 340 341 ### HTTP response details 342 343 | Status code | Description | Response headers | 344 |-------------|-------------|------------------| 345 **204** | repository deleted successfully | - | 346 **401** | Unauthorized | - | 347 **404** | Resource Not Found | - | 348 **420** | too many requests | - | 349 **0** | Internal Server Error | - | 350 351 [[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) 352 353 # **dump_status** 354 > RepositoryDumpStatus dump_status(repository, task_id) 355 356 Status of a repository dump task 357 358 ### Example 359 360 * Basic Authentication (basic_auth): 361 * Api Key Authentication (cookie_auth): 362 * Api Key Authentication (oidc_auth): 363 * Api Key Authentication (saml_auth): 364 * Bearer (JWT) Authentication (jwt_token): 365 366 ```python 367 import time 368 import os 369 import lakefs_sdk 370 from lakefs_sdk.models.repository_dump_status import RepositoryDumpStatus 371 from lakefs_sdk.rest import ApiException 372 from pprint import pprint 373 374 # Defining the host is optional and defaults to /api/v1 375 # See configuration.py for a list of all supported configuration parameters. 376 configuration = lakefs_sdk.Configuration( 377 host = "/api/v1" 378 ) 379 380 # The client must configure the authentication and authorization parameters 381 # in accordance with the API server security policy. 382 # Examples for each auth method are provided below, use the example that 383 # satisfies your auth use case. 384 385 # Configure HTTP basic authorization: basic_auth 386 configuration = lakefs_sdk.Configuration( 387 username = os.environ["USERNAME"], 388 password = os.environ["PASSWORD"] 389 ) 390 391 # Configure API key authorization: cookie_auth 392 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 393 394 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 395 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 396 397 # Configure API key authorization: oidc_auth 398 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 399 400 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 401 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 402 403 # Configure API key authorization: saml_auth 404 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 405 406 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 407 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 408 409 # Configure Bearer authorization (JWT): jwt_token 410 configuration = lakefs_sdk.Configuration( 411 access_token = os.environ["BEARER_TOKEN"] 412 ) 413 414 # Enter a context with an instance of the API client 415 with lakefs_sdk.ApiClient(configuration) as api_client: 416 # Create an instance of the API class 417 api_instance = lakefs_sdk.RepositoriesApi(api_client) 418 repository = 'repository_example' # str | 419 task_id = 'task_id_example' # str | 420 421 try: 422 # Status of a repository dump task 423 api_response = api_instance.dump_status(repository, task_id) 424 print("The response of RepositoriesApi->dump_status:\n") 425 pprint(api_response) 426 except Exception as e: 427 print("Exception when calling RepositoriesApi->dump_status: %s\n" % e) 428 ``` 429 430 431 432 ### Parameters 433 434 435 Name | Type | Description | Notes 436 ------------- | ------------- | ------------- | ------------- 437 **repository** | **str**| | 438 **task_id** | **str**| | 439 440 ### Return type 441 442 [**RepositoryDumpStatus**](RepositoryDumpStatus.md) 443 444 ### Authorization 445 446 [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) 447 448 ### HTTP request headers 449 450 - **Content-Type**: Not defined 451 - **Accept**: application/json 452 453 ### HTTP response details 454 455 | Status code | Description | Response headers | 456 |-------------|-------------|------------------| 457 **200** | dump task status | - | 458 **400** | Validation Error | - | 459 **401** | Unauthorized | - | 460 **404** | Resource Not Found | - | 461 **420** | too many requests | - | 462 **0** | Internal Server Error | - | 463 464 [[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) 465 466 # **dump_submit** 467 > TaskInfo dump_submit(repository) 468 469 Backup the repository metadata (tags, commits, branches) and save the backup to the object store. 470 471 ### Example 472 473 * Basic Authentication (basic_auth): 474 * Api Key Authentication (cookie_auth): 475 * Api Key Authentication (oidc_auth): 476 * Api Key Authentication (saml_auth): 477 * Bearer (JWT) Authentication (jwt_token): 478 479 ```python 480 import time 481 import os 482 import lakefs_sdk 483 from lakefs_sdk.models.task_info import TaskInfo 484 from lakefs_sdk.rest import ApiException 485 from pprint import pprint 486 487 # Defining the host is optional and defaults to /api/v1 488 # See configuration.py for a list of all supported configuration parameters. 489 configuration = lakefs_sdk.Configuration( 490 host = "/api/v1" 491 ) 492 493 # The client must configure the authentication and authorization parameters 494 # in accordance with the API server security policy. 495 # Examples for each auth method are provided below, use the example that 496 # satisfies your auth use case. 497 498 # Configure HTTP basic authorization: basic_auth 499 configuration = lakefs_sdk.Configuration( 500 username = os.environ["USERNAME"], 501 password = os.environ["PASSWORD"] 502 ) 503 504 # Configure API key authorization: cookie_auth 505 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 506 507 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 508 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 509 510 # Configure API key authorization: oidc_auth 511 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 512 513 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 514 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 515 516 # Configure API key authorization: saml_auth 517 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 518 519 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 520 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 521 522 # Configure Bearer authorization (JWT): jwt_token 523 configuration = lakefs_sdk.Configuration( 524 access_token = os.environ["BEARER_TOKEN"] 525 ) 526 527 # Enter a context with an instance of the API client 528 with lakefs_sdk.ApiClient(configuration) as api_client: 529 # Create an instance of the API class 530 api_instance = lakefs_sdk.RepositoriesApi(api_client) 531 repository = 'repository_example' # str | 532 533 try: 534 # Backup the repository metadata (tags, commits, branches) and save the backup to the object store. 535 api_response = api_instance.dump_submit(repository) 536 print("The response of RepositoriesApi->dump_submit:\n") 537 pprint(api_response) 538 except Exception as e: 539 print("Exception when calling RepositoriesApi->dump_submit: %s\n" % e) 540 ``` 541 542 543 544 ### Parameters 545 546 547 Name | Type | Description | Notes 548 ------------- | ------------- | ------------- | ------------- 549 **repository** | **str**| | 550 551 ### Return type 552 553 [**TaskInfo**](TaskInfo.md) 554 555 ### Authorization 556 557 [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) 558 559 ### HTTP request headers 560 561 - **Content-Type**: Not defined 562 - **Accept**: application/json 563 564 ### HTTP response details 565 566 | Status code | Description | Response headers | 567 |-------------|-------------|------------------| 568 **202** | dump task information | - | 569 **400** | Validation Error | - | 570 **401** | Unauthorized | - | 571 **404** | Resource Not Found | - | 572 **0** | Internal Server Error | - | 573 574 [[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) 575 576 # **get_branch_protection_rules** 577 > List[BranchProtectionRule] get_branch_protection_rules(repository) 578 579 get branch protection rules 580 581 ### Example 582 583 * Basic Authentication (basic_auth): 584 * Api Key Authentication (cookie_auth): 585 * Api Key Authentication (oidc_auth): 586 * Api Key Authentication (saml_auth): 587 * Bearer (JWT) Authentication (jwt_token): 588 589 ```python 590 import time 591 import os 592 import lakefs_sdk 593 from lakefs_sdk.models.branch_protection_rule import BranchProtectionRule 594 from lakefs_sdk.rest import ApiException 595 from pprint import pprint 596 597 # Defining the host is optional and defaults to /api/v1 598 # See configuration.py for a list of all supported configuration parameters. 599 configuration = lakefs_sdk.Configuration( 600 host = "/api/v1" 601 ) 602 603 # The client must configure the authentication and authorization parameters 604 # in accordance with the API server security policy. 605 # Examples for each auth method are provided below, use the example that 606 # satisfies your auth use case. 607 608 # Configure HTTP basic authorization: basic_auth 609 configuration = lakefs_sdk.Configuration( 610 username = os.environ["USERNAME"], 611 password = os.environ["PASSWORD"] 612 ) 613 614 # Configure API key authorization: cookie_auth 615 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 616 617 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 618 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 619 620 # Configure API key authorization: oidc_auth 621 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 622 623 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 624 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 625 626 # Configure API key authorization: saml_auth 627 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 628 629 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 630 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 631 632 # Configure Bearer authorization (JWT): jwt_token 633 configuration = lakefs_sdk.Configuration( 634 access_token = os.environ["BEARER_TOKEN"] 635 ) 636 637 # Enter a context with an instance of the API client 638 with lakefs_sdk.ApiClient(configuration) as api_client: 639 # Create an instance of the API class 640 api_instance = lakefs_sdk.RepositoriesApi(api_client) 641 repository = 'repository_example' # str | 642 643 try: 644 # get branch protection rules 645 api_response = api_instance.get_branch_protection_rules(repository) 646 print("The response of RepositoriesApi->get_branch_protection_rules:\n") 647 pprint(api_response) 648 except Exception as e: 649 print("Exception when calling RepositoriesApi->get_branch_protection_rules: %s\n" % e) 650 ``` 651 652 653 654 ### Parameters 655 656 657 Name | Type | Description | Notes 658 ------------- | ------------- | ------------- | ------------- 659 **repository** | **str**| | 660 661 ### Return type 662 663 [**List[BranchProtectionRule]**](BranchProtectionRule.md) 664 665 ### Authorization 666 667 [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) 668 669 ### HTTP request headers 670 671 - **Content-Type**: Not defined 672 - **Accept**: application/json 673 674 ### HTTP response details 675 676 | Status code | Description | Response headers | 677 |-------------|-------------|------------------| 678 **200** | branch protection rules | * ETag - <br> | 679 **401** | Unauthorized | - | 680 **404** | Resource Not Found | - | 681 **420** | too many requests | - | 682 **0** | Internal Server Error | - | 683 684 [[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) 685 686 # **get_gc_rules** 687 > GarbageCollectionRules get_gc_rules(repository) 688 689 get repository GC rules 690 691 ### Example 692 693 * Basic Authentication (basic_auth): 694 * Api Key Authentication (cookie_auth): 695 * Api Key Authentication (oidc_auth): 696 * Api Key Authentication (saml_auth): 697 * Bearer (JWT) Authentication (jwt_token): 698 699 ```python 700 import time 701 import os 702 import lakefs_sdk 703 from lakefs_sdk.models.garbage_collection_rules import GarbageCollectionRules 704 from lakefs_sdk.rest import ApiException 705 from pprint import pprint 706 707 # Defining the host is optional and defaults to /api/v1 708 # See configuration.py for a list of all supported configuration parameters. 709 configuration = lakefs_sdk.Configuration( 710 host = "/api/v1" 711 ) 712 713 # The client must configure the authentication and authorization parameters 714 # in accordance with the API server security policy. 715 # Examples for each auth method are provided below, use the example that 716 # satisfies your auth use case. 717 718 # Configure HTTP basic authorization: basic_auth 719 configuration = lakefs_sdk.Configuration( 720 username = os.environ["USERNAME"], 721 password = os.environ["PASSWORD"] 722 ) 723 724 # Configure API key authorization: cookie_auth 725 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 726 727 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 728 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 729 730 # Configure API key authorization: oidc_auth 731 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 732 733 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 734 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 735 736 # Configure API key authorization: saml_auth 737 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 738 739 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 740 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 741 742 # Configure Bearer authorization (JWT): jwt_token 743 configuration = lakefs_sdk.Configuration( 744 access_token = os.environ["BEARER_TOKEN"] 745 ) 746 747 # Enter a context with an instance of the API client 748 with lakefs_sdk.ApiClient(configuration) as api_client: 749 # Create an instance of the API class 750 api_instance = lakefs_sdk.RepositoriesApi(api_client) 751 repository = 'repository_example' # str | 752 753 try: 754 # get repository GC rules 755 api_response = api_instance.get_gc_rules(repository) 756 print("The response of RepositoriesApi->get_gc_rules:\n") 757 pprint(api_response) 758 except Exception as e: 759 print("Exception when calling RepositoriesApi->get_gc_rules: %s\n" % e) 760 ``` 761 762 763 764 ### Parameters 765 766 767 Name | Type | Description | Notes 768 ------------- | ------------- | ------------- | ------------- 769 **repository** | **str**| | 770 771 ### Return type 772 773 [**GarbageCollectionRules**](GarbageCollectionRules.md) 774 775 ### Authorization 776 777 [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) 778 779 ### HTTP request headers 780 781 - **Content-Type**: Not defined 782 - **Accept**: application/json 783 784 ### HTTP response details 785 786 | Status code | Description | Response headers | 787 |-------------|-------------|------------------| 788 **200** | repository GC rules | - | 789 **401** | Unauthorized | - | 790 **404** | Resource Not Found | - | 791 **420** | too many requests | - | 792 **0** | Internal Server Error | - | 793 794 [[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) 795 796 # **get_repository** 797 > Repository get_repository(repository) 798 799 get repository 800 801 ### Example 802 803 * Basic Authentication (basic_auth): 804 * Api Key Authentication (cookie_auth): 805 * Api Key Authentication (oidc_auth): 806 * Api Key Authentication (saml_auth): 807 * Bearer (JWT) Authentication (jwt_token): 808 809 ```python 810 import time 811 import os 812 import lakefs_sdk 813 from lakefs_sdk.models.repository import Repository 814 from lakefs_sdk.rest import ApiException 815 from pprint import pprint 816 817 # Defining the host is optional and defaults to /api/v1 818 # See configuration.py for a list of all supported configuration parameters. 819 configuration = lakefs_sdk.Configuration( 820 host = "/api/v1" 821 ) 822 823 # The client must configure the authentication and authorization parameters 824 # in accordance with the API server security policy. 825 # Examples for each auth method are provided below, use the example that 826 # satisfies your auth use case. 827 828 # Configure HTTP basic authorization: basic_auth 829 configuration = lakefs_sdk.Configuration( 830 username = os.environ["USERNAME"], 831 password = os.environ["PASSWORD"] 832 ) 833 834 # Configure API key authorization: cookie_auth 835 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 836 837 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 838 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 839 840 # Configure API key authorization: oidc_auth 841 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 842 843 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 844 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 845 846 # Configure API key authorization: saml_auth 847 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 848 849 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 850 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 851 852 # Configure Bearer authorization (JWT): jwt_token 853 configuration = lakefs_sdk.Configuration( 854 access_token = os.environ["BEARER_TOKEN"] 855 ) 856 857 # Enter a context with an instance of the API client 858 with lakefs_sdk.ApiClient(configuration) as api_client: 859 # Create an instance of the API class 860 api_instance = lakefs_sdk.RepositoriesApi(api_client) 861 repository = 'repository_example' # str | 862 863 try: 864 # get repository 865 api_response = api_instance.get_repository(repository) 866 print("The response of RepositoriesApi->get_repository:\n") 867 pprint(api_response) 868 except Exception as e: 869 print("Exception when calling RepositoriesApi->get_repository: %s\n" % e) 870 ``` 871 872 873 874 ### Parameters 875 876 877 Name | Type | Description | Notes 878 ------------- | ------------- | ------------- | ------------- 879 **repository** | **str**| | 880 881 ### Return type 882 883 [**Repository**](Repository.md) 884 885 ### Authorization 886 887 [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) 888 889 ### HTTP request headers 890 891 - **Content-Type**: Not defined 892 - **Accept**: application/json 893 894 ### HTTP response details 895 896 | Status code | Description | Response headers | 897 |-------------|-------------|------------------| 898 **200** | repository | - | 899 **401** | Unauthorized | - | 900 **404** | Resource Not Found | - | 901 **420** | too many requests | - | 902 **0** | Internal Server Error | - | 903 904 [[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) 905 906 # **get_repository_metadata** 907 > Dict[str, str] get_repository_metadata(repository) 908 909 get repository metadata 910 911 ### Example 912 913 * Basic Authentication (basic_auth): 914 * Api Key Authentication (cookie_auth): 915 * Api Key Authentication (oidc_auth): 916 * Api Key Authentication (saml_auth): 917 * Bearer (JWT) Authentication (jwt_token): 918 919 ```python 920 import time 921 import os 922 import lakefs_sdk 923 from lakefs_sdk.rest import ApiException 924 from pprint import pprint 925 926 # Defining the host is optional and defaults to /api/v1 927 # See configuration.py for a list of all supported configuration parameters. 928 configuration = lakefs_sdk.Configuration( 929 host = "/api/v1" 930 ) 931 932 # The client must configure the authentication and authorization parameters 933 # in accordance with the API server security policy. 934 # Examples for each auth method are provided below, use the example that 935 # satisfies your auth use case. 936 937 # Configure HTTP basic authorization: basic_auth 938 configuration = lakefs_sdk.Configuration( 939 username = os.environ["USERNAME"], 940 password = os.environ["PASSWORD"] 941 ) 942 943 # Configure API key authorization: cookie_auth 944 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 945 946 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 947 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 948 949 # Configure API key authorization: oidc_auth 950 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 951 952 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 953 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 954 955 # Configure API key authorization: saml_auth 956 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 957 958 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 959 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 960 961 # Configure Bearer authorization (JWT): jwt_token 962 configuration = lakefs_sdk.Configuration( 963 access_token = os.environ["BEARER_TOKEN"] 964 ) 965 966 # Enter a context with an instance of the API client 967 with lakefs_sdk.ApiClient(configuration) as api_client: 968 # Create an instance of the API class 969 api_instance = lakefs_sdk.RepositoriesApi(api_client) 970 repository = 'repository_example' # str | 971 972 try: 973 # get repository metadata 974 api_response = api_instance.get_repository_metadata(repository) 975 print("The response of RepositoriesApi->get_repository_metadata:\n") 976 pprint(api_response) 977 except Exception as e: 978 print("Exception when calling RepositoriesApi->get_repository_metadata: %s\n" % e) 979 ``` 980 981 982 983 ### Parameters 984 985 986 Name | Type | Description | Notes 987 ------------- | ------------- | ------------- | ------------- 988 **repository** | **str**| | 989 990 ### Return type 991 992 **Dict[str, str]** 993 994 ### Authorization 995 996 [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) 997 998 ### HTTP request headers 999 1000 - **Content-Type**: Not defined 1001 - **Accept**: application/json 1002 1003 ### HTTP response details 1004 1005 | Status code | Description | Response headers | 1006 |-------------|-------------|------------------| 1007 **200** | repository metadata | - | 1008 **401** | Unauthorized | - | 1009 **404** | Resource Not Found | - | 1010 **420** | too many requests | - | 1011 **0** | Internal Server Error | - | 1012 1013 [[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) 1014 1015 # **list_repositories** 1016 > RepositoryList list_repositories(prefix=prefix, after=after, amount=amount) 1017 1018 list repositories 1019 1020 ### Example 1021 1022 * Basic Authentication (basic_auth): 1023 * Api Key Authentication (cookie_auth): 1024 * Api Key Authentication (oidc_auth): 1025 * Api Key Authentication (saml_auth): 1026 * Bearer (JWT) Authentication (jwt_token): 1027 1028 ```python 1029 import time 1030 import os 1031 import lakefs_sdk 1032 from lakefs_sdk.models.repository_list import RepositoryList 1033 from lakefs_sdk.rest import ApiException 1034 from pprint import pprint 1035 1036 # Defining the host is optional and defaults to /api/v1 1037 # See configuration.py for a list of all supported configuration parameters. 1038 configuration = lakefs_sdk.Configuration( 1039 host = "/api/v1" 1040 ) 1041 1042 # The client must configure the authentication and authorization parameters 1043 # in accordance with the API server security policy. 1044 # Examples for each auth method are provided below, use the example that 1045 # satisfies your auth use case. 1046 1047 # Configure HTTP basic authorization: basic_auth 1048 configuration = lakefs_sdk.Configuration( 1049 username = os.environ["USERNAME"], 1050 password = os.environ["PASSWORD"] 1051 ) 1052 1053 # Configure API key authorization: cookie_auth 1054 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 1055 1056 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1057 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 1058 1059 # Configure API key authorization: oidc_auth 1060 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 1061 1062 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1063 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 1064 1065 # Configure API key authorization: saml_auth 1066 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 1067 1068 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1069 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 1070 1071 # Configure Bearer authorization (JWT): jwt_token 1072 configuration = lakefs_sdk.Configuration( 1073 access_token = os.environ["BEARER_TOKEN"] 1074 ) 1075 1076 # Enter a context with an instance of the API client 1077 with lakefs_sdk.ApiClient(configuration) as api_client: 1078 # Create an instance of the API class 1079 api_instance = lakefs_sdk.RepositoriesApi(api_client) 1080 prefix = 'prefix_example' # str | return items prefixed with this value (optional) 1081 after = 'after_example' # str | return items after this value (optional) 1082 amount = 100 # int | how many items to return (optional) (default to 100) 1083 1084 try: 1085 # list repositories 1086 api_response = api_instance.list_repositories(prefix=prefix, after=after, amount=amount) 1087 print("The response of RepositoriesApi->list_repositories:\n") 1088 pprint(api_response) 1089 except Exception as e: 1090 print("Exception when calling RepositoriesApi->list_repositories: %s\n" % e) 1091 ``` 1092 1093 1094 1095 ### Parameters 1096 1097 1098 Name | Type | Description | Notes 1099 ------------- | ------------- | ------------- | ------------- 1100 **prefix** | **str**| return items prefixed with this value | [optional] 1101 **after** | **str**| return items after this value | [optional] 1102 **amount** | **int**| how many items to return | [optional] [default to 100] 1103 1104 ### Return type 1105 1106 [**RepositoryList**](RepositoryList.md) 1107 1108 ### Authorization 1109 1110 [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) 1111 1112 ### HTTP request headers 1113 1114 - **Content-Type**: Not defined 1115 - **Accept**: application/json 1116 1117 ### HTTP response details 1118 1119 | Status code | Description | Response headers | 1120 |-------------|-------------|------------------| 1121 **200** | repository list | - | 1122 **401** | Unauthorized | - | 1123 **420** | too many requests | - | 1124 **0** | Internal Server Error | - | 1125 1126 [[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) 1127 1128 # **restore_status** 1129 > RepositoryRestoreStatus restore_status(repository, task_id) 1130 1131 Status of a restore request 1132 1133 ### Example 1134 1135 * Basic Authentication (basic_auth): 1136 * Api Key Authentication (cookie_auth): 1137 * Api Key Authentication (oidc_auth): 1138 * Api Key Authentication (saml_auth): 1139 * Bearer (JWT) Authentication (jwt_token): 1140 1141 ```python 1142 import time 1143 import os 1144 import lakefs_sdk 1145 from lakefs_sdk.models.repository_restore_status import RepositoryRestoreStatus 1146 from lakefs_sdk.rest import ApiException 1147 from pprint import pprint 1148 1149 # Defining the host is optional and defaults to /api/v1 1150 # See configuration.py for a list of all supported configuration parameters. 1151 configuration = lakefs_sdk.Configuration( 1152 host = "/api/v1" 1153 ) 1154 1155 # The client must configure the authentication and authorization parameters 1156 # in accordance with the API server security policy. 1157 # Examples for each auth method are provided below, use the example that 1158 # satisfies your auth use case. 1159 1160 # Configure HTTP basic authorization: basic_auth 1161 configuration = lakefs_sdk.Configuration( 1162 username = os.environ["USERNAME"], 1163 password = os.environ["PASSWORD"] 1164 ) 1165 1166 # Configure API key authorization: cookie_auth 1167 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 1168 1169 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1170 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 1171 1172 # Configure API key authorization: oidc_auth 1173 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 1174 1175 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1176 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 1177 1178 # Configure API key authorization: saml_auth 1179 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 1180 1181 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1182 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 1183 1184 # Configure Bearer authorization (JWT): jwt_token 1185 configuration = lakefs_sdk.Configuration( 1186 access_token = os.environ["BEARER_TOKEN"] 1187 ) 1188 1189 # Enter a context with an instance of the API client 1190 with lakefs_sdk.ApiClient(configuration) as api_client: 1191 # Create an instance of the API class 1192 api_instance = lakefs_sdk.RepositoriesApi(api_client) 1193 repository = 'repository_example' # str | 1194 task_id = 'task_id_example' # str | 1195 1196 try: 1197 # Status of a restore request 1198 api_response = api_instance.restore_status(repository, task_id) 1199 print("The response of RepositoriesApi->restore_status:\n") 1200 pprint(api_response) 1201 except Exception as e: 1202 print("Exception when calling RepositoriesApi->restore_status: %s\n" % e) 1203 ``` 1204 1205 1206 1207 ### Parameters 1208 1209 1210 Name | Type | Description | Notes 1211 ------------- | ------------- | ------------- | ------------- 1212 **repository** | **str**| | 1213 **task_id** | **str**| | 1214 1215 ### Return type 1216 1217 [**RepositoryRestoreStatus**](RepositoryRestoreStatus.md) 1218 1219 ### Authorization 1220 1221 [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) 1222 1223 ### HTTP request headers 1224 1225 - **Content-Type**: Not defined 1226 - **Accept**: application/json 1227 1228 ### HTTP response details 1229 1230 | Status code | Description | Response headers | 1231 |-------------|-------------|------------------| 1232 **200** | restore task status | - | 1233 **400** | Validation Error | - | 1234 **401** | Unauthorized | - | 1235 **404** | Resource Not Found | - | 1236 **420** | too many requests | - | 1237 **0** | Internal Server Error | - | 1238 1239 [[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) 1240 1241 # **restore_submit** 1242 > TaskInfo restore_submit(repository, refs_restore) 1243 1244 Restore repository from a dump in the object store 1245 1246 ### Example 1247 1248 * Basic Authentication (basic_auth): 1249 * Api Key Authentication (cookie_auth): 1250 * Api Key Authentication (oidc_auth): 1251 * Api Key Authentication (saml_auth): 1252 * Bearer (JWT) Authentication (jwt_token): 1253 1254 ```python 1255 import time 1256 import os 1257 import lakefs_sdk 1258 from lakefs_sdk.models.refs_restore import RefsRestore 1259 from lakefs_sdk.models.task_info import TaskInfo 1260 from lakefs_sdk.rest import ApiException 1261 from pprint import pprint 1262 1263 # Defining the host is optional and defaults to /api/v1 1264 # See configuration.py for a list of all supported configuration parameters. 1265 configuration = lakefs_sdk.Configuration( 1266 host = "/api/v1" 1267 ) 1268 1269 # The client must configure the authentication and authorization parameters 1270 # in accordance with the API server security policy. 1271 # Examples for each auth method are provided below, use the example that 1272 # satisfies your auth use case. 1273 1274 # Configure HTTP basic authorization: basic_auth 1275 configuration = lakefs_sdk.Configuration( 1276 username = os.environ["USERNAME"], 1277 password = os.environ["PASSWORD"] 1278 ) 1279 1280 # Configure API key authorization: cookie_auth 1281 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 1282 1283 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1284 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 1285 1286 # Configure API key authorization: oidc_auth 1287 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 1288 1289 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1290 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 1291 1292 # Configure API key authorization: saml_auth 1293 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 1294 1295 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1296 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 1297 1298 # Configure Bearer authorization (JWT): jwt_token 1299 configuration = lakefs_sdk.Configuration( 1300 access_token = os.environ["BEARER_TOKEN"] 1301 ) 1302 1303 # Enter a context with an instance of the API client 1304 with lakefs_sdk.ApiClient(configuration) as api_client: 1305 # Create an instance of the API class 1306 api_instance = lakefs_sdk.RepositoriesApi(api_client) 1307 repository = 'repository_example' # str | 1308 refs_restore = lakefs_sdk.RefsRestore() # RefsRestore | 1309 1310 try: 1311 # Restore repository from a dump in the object store 1312 api_response = api_instance.restore_submit(repository, refs_restore) 1313 print("The response of RepositoriesApi->restore_submit:\n") 1314 pprint(api_response) 1315 except Exception as e: 1316 print("Exception when calling RepositoriesApi->restore_submit: %s\n" % e) 1317 ``` 1318 1319 1320 1321 ### Parameters 1322 1323 1324 Name | Type | Description | Notes 1325 ------------- | ------------- | ------------- | ------------- 1326 **repository** | **str**| | 1327 **refs_restore** | [**RefsRestore**](RefsRestore.md)| | 1328 1329 ### Return type 1330 1331 [**TaskInfo**](TaskInfo.md) 1332 1333 ### Authorization 1334 1335 [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) 1336 1337 ### HTTP request headers 1338 1339 - **Content-Type**: application/json 1340 - **Accept**: application/json 1341 1342 ### HTTP response details 1343 1344 | Status code | Description | Response headers | 1345 |-------------|-------------|------------------| 1346 **202** | restore task created | - | 1347 **400** | Validation Error | - | 1348 **403** | Forbidden | - | 1349 **401** | Unauthorized | - | 1350 **404** | Resource Not Found | - | 1351 **0** | Internal Server Error | - | 1352 1353 [[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) 1354 1355 # **set_branch_protection_rules** 1356 > set_branch_protection_rules(repository, branch_protection_rule, if_match=if_match) 1357 1358 1359 1360 ### Example 1361 1362 * Basic Authentication (basic_auth): 1363 * Api Key Authentication (cookie_auth): 1364 * Api Key Authentication (oidc_auth): 1365 * Api Key Authentication (saml_auth): 1366 * Bearer (JWT) Authentication (jwt_token): 1367 1368 ```python 1369 import time 1370 import os 1371 import lakefs_sdk 1372 from lakefs_sdk.models.branch_protection_rule import BranchProtectionRule 1373 from lakefs_sdk.rest import ApiException 1374 from pprint import pprint 1375 1376 # Defining the host is optional and defaults to /api/v1 1377 # See configuration.py for a list of all supported configuration parameters. 1378 configuration = lakefs_sdk.Configuration( 1379 host = "/api/v1" 1380 ) 1381 1382 # The client must configure the authentication and authorization parameters 1383 # in accordance with the API server security policy. 1384 # Examples for each auth method are provided below, use the example that 1385 # satisfies your auth use case. 1386 1387 # Configure HTTP basic authorization: basic_auth 1388 configuration = lakefs_sdk.Configuration( 1389 username = os.environ["USERNAME"], 1390 password = os.environ["PASSWORD"] 1391 ) 1392 1393 # Configure API key authorization: cookie_auth 1394 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 1395 1396 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1397 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 1398 1399 # Configure API key authorization: oidc_auth 1400 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 1401 1402 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1403 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 1404 1405 # Configure API key authorization: saml_auth 1406 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 1407 1408 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1409 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 1410 1411 # Configure Bearer authorization (JWT): jwt_token 1412 configuration = lakefs_sdk.Configuration( 1413 access_token = os.environ["BEARER_TOKEN"] 1414 ) 1415 1416 # Enter a context with an instance of the API client 1417 with lakefs_sdk.ApiClient(configuration) as api_client: 1418 # Create an instance of the API class 1419 api_instance = lakefs_sdk.RepositoriesApi(api_client) 1420 repository = 'repository_example' # str | 1421 branch_protection_rule = [lakefs_sdk.BranchProtectionRule()] # List[BranchProtectionRule] | 1422 if_match = 'if_match_example' # str | if provided, the branch protection rules will be updated only if the current ETag match the provided value (optional) 1423 1424 try: 1425 api_instance.set_branch_protection_rules(repository, branch_protection_rule, if_match=if_match) 1426 except Exception as e: 1427 print("Exception when calling RepositoriesApi->set_branch_protection_rules: %s\n" % e) 1428 ``` 1429 1430 1431 1432 ### Parameters 1433 1434 1435 Name | Type | Description | Notes 1436 ------------- | ------------- | ------------- | ------------- 1437 **repository** | **str**| | 1438 **branch_protection_rule** | [**List[BranchProtectionRule]**](BranchProtectionRule.md)| | 1439 **if_match** | **str**| if provided, the branch protection rules will be updated only if the current ETag match the provided value | [optional] 1440 1441 ### Return type 1442 1443 void (empty response body) 1444 1445 ### Authorization 1446 1447 [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) 1448 1449 ### HTTP request headers 1450 1451 - **Content-Type**: application/json 1452 - **Accept**: application/json 1453 1454 ### HTTP response details 1455 1456 | Status code | Description | Response headers | 1457 |-------------|-------------|------------------| 1458 **204** | branch protection rule created successfully | - | 1459 **400** | Bad Request | - | 1460 **401** | Unauthorized | - | 1461 **403** | Forbidden | - | 1462 **404** | Resource Not Found | - | 1463 **412** | Precondition Failed | - | 1464 **420** | too many requests | - | 1465 **0** | Internal Server Error | - | 1466 1467 [[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) 1468 1469 # **set_gc_rules** 1470 > set_gc_rules(repository, garbage_collection_rules) 1471 1472 1473 1474 ### Example 1475 1476 * Basic Authentication (basic_auth): 1477 * Api Key Authentication (cookie_auth): 1478 * Api Key Authentication (oidc_auth): 1479 * Api Key Authentication (saml_auth): 1480 * Bearer (JWT) Authentication (jwt_token): 1481 1482 ```python 1483 import time 1484 import os 1485 import lakefs_sdk 1486 from lakefs_sdk.models.garbage_collection_rules import GarbageCollectionRules 1487 from lakefs_sdk.rest import ApiException 1488 from pprint import pprint 1489 1490 # Defining the host is optional and defaults to /api/v1 1491 # See configuration.py for a list of all supported configuration parameters. 1492 configuration = lakefs_sdk.Configuration( 1493 host = "/api/v1" 1494 ) 1495 1496 # The client must configure the authentication and authorization parameters 1497 # in accordance with the API server security policy. 1498 # Examples for each auth method are provided below, use the example that 1499 # satisfies your auth use case. 1500 1501 # Configure HTTP basic authorization: basic_auth 1502 configuration = lakefs_sdk.Configuration( 1503 username = os.environ["USERNAME"], 1504 password = os.environ["PASSWORD"] 1505 ) 1506 1507 # Configure API key authorization: cookie_auth 1508 configuration.api_key['cookie_auth'] = os.environ["API_KEY"] 1509 1510 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1511 # configuration.api_key_prefix['cookie_auth'] = 'Bearer' 1512 1513 # Configure API key authorization: oidc_auth 1514 configuration.api_key['oidc_auth'] = os.environ["API_KEY"] 1515 1516 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1517 # configuration.api_key_prefix['oidc_auth'] = 'Bearer' 1518 1519 # Configure API key authorization: saml_auth 1520 configuration.api_key['saml_auth'] = os.environ["API_KEY"] 1521 1522 # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 1523 # configuration.api_key_prefix['saml_auth'] = 'Bearer' 1524 1525 # Configure Bearer authorization (JWT): jwt_token 1526 configuration = lakefs_sdk.Configuration( 1527 access_token = os.environ["BEARER_TOKEN"] 1528 ) 1529 1530 # Enter a context with an instance of the API client 1531 with lakefs_sdk.ApiClient(configuration) as api_client: 1532 # Create an instance of the API class 1533 api_instance = lakefs_sdk.RepositoriesApi(api_client) 1534 repository = 'repository_example' # str | 1535 garbage_collection_rules = lakefs_sdk.GarbageCollectionRules() # GarbageCollectionRules | 1536 1537 try: 1538 api_instance.set_gc_rules(repository, garbage_collection_rules) 1539 except Exception as e: 1540 print("Exception when calling RepositoriesApi->set_gc_rules: %s\n" % e) 1541 ``` 1542 1543 1544 1545 ### Parameters 1546 1547 1548 Name | Type | Description | Notes 1549 ------------- | ------------- | ------------- | ------------- 1550 **repository** | **str**| | 1551 **garbage_collection_rules** | [**GarbageCollectionRules**](GarbageCollectionRules.md)| | 1552 1553 ### Return type 1554 1555 void (empty response body) 1556 1557 ### Authorization 1558 1559 [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) 1560 1561 ### HTTP request headers 1562 1563 - **Content-Type**: application/json 1564 - **Accept**: application/json 1565 1566 ### HTTP response details 1567 1568 | Status code | Description | Response headers | 1569 |-------------|-------------|------------------| 1570 **204** | set garbage collection rules successfully | - | 1571 **401** | Unauthorized | - | 1572 **403** | Forbidden | - | 1573 **404** | Resource Not Found | - | 1574 **420** | too many requests | - | 1575 **0** | Internal Server Error | - | 1576 1577 [[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) 1578