-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from cbrainerd/feat_pypi_doc_rebased
Updates to prepare for PyPI releases.
- Loading branch information
Showing
6 changed files
with
147 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
## About | ||
This package is part of the Isilon SDK. It includes language bindings for easier programmatic access to the OneFS API for cluster configuration (on your cluster this is the REST API made up of all the URIs underneath https://[cluster]:8080/platform/*, also called the "Platform API" or PAPI"). | ||
|
||
## Installation | ||
|
||
`pip install PKG_NAME` | ||
|
||
|
||
## Example program | ||
|
||
Here's an example of using the Python PAPI bindings to retrieve a list of NFS exports from your cluster: | ||
|
||
```python | ||
import PKG_NAME | ||
from PKG_NAME.rest import ApiException | ||
from pprint import pprint | ||
import urllib3 | ||
urllib3.disable_warnings() | ||
|
||
# configure username and password | ||
PKG_NAME.configuration.username = "YOUR_USERNAME" | ||
PKG_NAME.configuration.password = "YOUR_PASSWORD" | ||
PKG_NAME.configuration.verify_ssl = False | ||
|
||
# configure host | ||
host = "https://YOUR_CLUSTER_HOSTNAME_OR_NODE_IP_ADDRESS:8080" | ||
api_client = PKG_NAME.ApiClient(host) | ||
protocols_api = PKG_NAME.ProtocolsApi(api_client) | ||
|
||
# get all exports | ||
sort = "description" | ||
limit = 50 | ||
dir = "ASC" | ||
try: | ||
api_response = protocols_api.list_nfs_exports(sort=sort, limit=limit, dir=dir) | ||
pprint(api_response) | ||
except ApiException as e: | ||
print "Exception when calling ProtocolsApi->list_nfs_exports: %s" % e | ||
``` | ||
|
||
There are more examples of coding to the Python PAPI bindings in the [`tests/`](https://github.com/Isilon/isilon_sdk/tree/master/tests) subdirectory of the repo. The tests currently run against a generic isi_sdk import which is how the bindings library is named by default if you build your own bindings. If you want to run the tests against one of the libraries you've downloaded from the prebuilt releases page, you should change the `import isi_sdk` lines to `import isi_sdk_7_2` or `import isi_sdk_8_0` depending on which one you downloaded. | ||
|
||
## More info | ||
See the Github repo for more information: | ||
[https://github.com/isilon/isilon_sdk](https://github.com/isilon/isilon_sdk) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
""" | ||
{{#appName}} | ||
{{{appName}}} | ||
{{/appName}} | ||
|
||
{{#appDescription}} | ||
{{{appDescription}}} | ||
{{/appDescription}} | ||
|
||
{{#version}}OpenAPI spec version: {{{version}}}{{/version}} | ||
{{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
|
||
Custom setup.py for isilon_sdk packages. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# coding: utf-8 | ||
|
||
{{>partial_header}} | ||
|
||
import sys | ||
from setuptools import setup, find_packages | ||
|
||
NAME = "{{packageName}}" | ||
VERSION = "{{packageVersion}}" | ||
LONG_DESCRIPTION = """\ | ||
{{appDescription}} | ||
""" | ||
|
||
{{#apiInfo}}{{#apis}}{{^hasMore}} | ||
|
||
# To install the library, run the following | ||
# | ||
# python setup.py install | ||
# | ||
# prerequisite: setuptools | ||
# http://pypi.python.org/pypi/setuptools | ||
|
||
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] | ||
|
||
setup( | ||
name=NAME, | ||
version=VERSION, | ||
description="{{appName}}", | ||
author_email="{{infoEmail}}", | ||
url="{{infoUrl}}", | ||
keywords=["Swagger", "{{appName}}"], | ||
install_requires=REQUIRES, | ||
packages=find_packages(), | ||
include_package_data=True, | ||
long_description=LONG_DESCRIPTION.replace('PKG_NAME', NAME) | ||
) | ||
|
||
{{/hasMore}}{{/apis}}{{/apiInfo}} |