You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
3.9 KiB

2 years ago
  1. # openapi-client
  2. The Seaweedfs Master Server API allows you to store blobs
  3. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
  4. - API version: 3.43.0
  5. - Package version: 1.0.0
  6. - Build package: org.openapitools.codegen.languages.PythonNextgenClientCodegen
  7. ## Requirements.
  8. Python 3.7+
  9. ## Installation & Usage
  10. ### pip install
  11. If the python package is hosted on a repository, you can install directly using:
  12. ```sh
  13. pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
  14. ```
  15. (you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
  16. Then import the package:
  17. ```python
  18. import openapi_client
  19. ```
  20. ### Setuptools
  21. Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
  22. ```sh
  23. python setup.py install --user
  24. ```
  25. (or `sudo python setup.py install` to install the package for all users)
  26. Then import the package:
  27. ```python
  28. import openapi_client
  29. ```
  30. ## Getting Started
  31. Please follow the [installation procedure](#installation--usage) and then run the following:
  32. ```python
  33. from __future__ import print_function
  34. import time
  35. import openapi_client
  36. from openapi_client.rest import ApiException
  37. from pprint import pprint
  38. # Defining the host is optional and defaults to https://127.0.0.1:9333
  39. # See configuration.py for a list of all supported configuration parameters.
  40. configuration = openapi_client.Configuration(
  41. host = "https://127.0.0.1:9333"
  42. )
  43. # Enter a context with an instance of the API client
  44. with openapi_client.ApiClient(configuration) as api_client:
  45. # Create an instance of the API class
  46. api_instance = openapi_client.DefaultApi(api_client)
  47. count = None # object | how many file ids to assign. Use <fid>_1, <fid>_2 for the assigned additional file ids. e.g. 3,01637037d6_1, 3,01637037d6_2 (optional)
  48. collection = None # object | required collection name (optional)
  49. data_center = None # object | preferred data center (optional)
  50. rack = None # object | preferred rack (optional)
  51. data_node = None # object | preferred volume server, e.g. 127.0.0.1:8080 (optional)
  52. disk = None # object | If you have disks labelled, this must be supplied to specify the disk type to allocate on. (optional)
  53. replication = None # object | replica placement strategy (optional)
  54. ttl = None # object | file expiration time limit, example: 3m for 3 minutes. units: m-minute, h-hour, d-day, w-week, M-month, y-year (optional)
  55. preallocate = None # object | If no matching volumes, pre-allocate this number of bytes on disk for new volumes. (optional)
  56. memory_map_max_size_mb = None # object | Only implemented for windows. Use memory mapped files with specified size for new volumes. (optional)
  57. writable_volume_count = None # object | If no matching volumes, create specified number of new volumes. (optional)
  58. try:
  59. # Assign a file key
  60. api_response = api_instance.dir_assign(count=count, collection=collection, data_center=data_center, rack=rack, data_node=data_node, disk=disk, replication=replication, ttl=ttl, preallocate=preallocate, memory_map_max_size_mb=memory_map_max_size_mb, writable_volume_count=writable_volume_count)
  61. print("The response of DefaultApi->dir_assign:\n")
  62. pprint(api_response)
  63. except ApiException as e:
  64. print("Exception when calling DefaultApi->dir_assign: %s\n" % e)
  65. ```
  66. ## Documentation for API Endpoints
  67. All URIs are relative to *https://127.0.0.1:9333*
  68. Class | Method | HTTP request | Description
  69. ------------ | ------------- | ------------- | -------------
  70. *DefaultApi* | [**dir_assign**](docs/DefaultApi.md#dir_assign) | **GET** /dir/assign | Assign a file key
  71. *DefaultApi* | [**dir_lookup**](docs/DefaultApi.md#dir_lookup) | **GET** /dir/lookup | Lookup volume
  72. ## Documentation For Models
  73. - [FileKey](docs/FileKey.md)
  74. - [Location](docs/Location.md)
  75. ## Documentation For Authorization
  76. All endpoints do not require authorization.
  77. ## Author