| copyright |
|
||
|---|---|---|---|
| lastupdated | 2026-06-08 | ||
| keywords | File Storage for Classic, NSF, SLAPI, Python | ||
| subcollection | FileStorage |
{{site.data.keyword.attribute-definition-list}}
{: #setupAPI}
Use the SLAPI to manage file storage volumes, place orders, update authorizations, and query capacity through programmatic access to {{site.data.keyword.cloud_notm}} services. {: shortdesc}
Before you begin, review the Introduction to the SL API{: external} in the API Reference{: external}. For more information about the {{site.data.keyword.filestorage_short}} service and available data types, see the SoftLayer_Network_Storage{: external} topic.
{: #setup-api-environment-import-manager} {: api}
You can pass your username and SL API Key every time you make an API request. You can also set your credentials as the environmental variables SL_USERNAME and SL_API_KEY, and create an environment that is only accessible from the {{site.data.keyword.cloud}} private network, and a timeout of 4 minutes. See the following example.
$ export SL_USERNAME=YOUR_USERNAME
$ export SL_API_KEY=YOUR_API_KEY
$ python
>>> import SoftLayer
>>> client = SoftLayer.create_client_from_env(username='YOUR_USERNAME',api_key='YOUR_API_KEY', endpoint_url=SoftLayer.API_PRIVATE_ENDPOINT, timeout=240){: codeblock}
For day-to-day operation, you might find the managers in the API Python client to be the most convenient means for interacting with the API. Managers abstract many of the complexities of using the API into classes that provide a simpler interface to various services. To interact with {{site.data.keyword.filestorage_short}} services, import the FileStorageManager.
from SoftLayer import BlockStorageManager, FileStorageManager, Client{: pre}
For more information, see SL API Client for Python{: external} and FileStorageManager{: external} topics.