Skip to content

Commit 8848861

Browse files
authored
Merge pull request #30 from tlewis-ps/master
REST SDK fixes for Release 1.9.2
2 parents 443e8ad + 8292cb8 commit 8848861

66 files changed

Lines changed: 1316 additions & 391 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

PKG-INFO

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Metadata-Version: 1.9.1
1+
Metadata-Version: 1.9.2
22
Name: purity_fb
3-
Version: 1.9.1
3+
Version: 1.9.2
44
Summary: Pure Storage FlashBlade REST 1.9 Python SDK.
55
License: Apache 2.0

README.md

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,41 @@ Pure Storage FlashBlade REST 1.9 Python SDK. Compatible with REST API versions 1
44
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
55

66
- API version: 1.9
7-
- Package version: 1.9.1
7+
- Package version: 1.9.2
88
- Build package: io.swagger.codegen.languages.PythonClientCodegen
99
For more information, please visit [http://www.purestorage.com](http://www.purestorage.com)
1010

11-
## Requirements.
11+
## Release Notes
12+
13+
- Package version: 1.9.2
14+
- Starting with package version 1.9.0, this SDK is incompatible with Python 3.7 or higher.
15+
- Starting with package version 1.9.0, the `account` parameter in the `create_buckets` function
16+
has been renamed to `bucket`. This is only applicable for API version 1.9+, and previous API
17+
versions still use `account`.
18+
- Using API version 1.9:
19+
```
20+
fb = PurityFb("10.255.9.28", version="1.9")
21+
attr = BucketPost()
22+
attr.account = Reference(name='myaccount')
23+
res = fb.buckets.create_buckets(names=["mybucket"], bucket=attr)
24+
```
25+
- Using API version 1.8:
26+
```
27+
fb = PurityFb("10.255.9.28", version="1.8")
28+
attr = BucketPost()
29+
attr.account = Reference(name='myaccount')
30+
res = fb.buckets.create_buckets(names=["mybucket"], account=attr)
31+
```
32+
33+
34+
## Requirements
35+
36+
* __Python 2.7 or Python 3.4-3.6__
37+
* certifi
38+
* python-dateutil
39+
* six >= 1.10
40+
* urllib3 >= 1.15
1241
13-
Python 2.7 or Python 3.4 - 3.6
1442
1543
## Installation & Usage
1644
### pip install
@@ -34,7 +62,7 @@ pip install git+https://github.com/purestorage/purity_fb_python_client.git
3462

3563
Then import the package:
3664
```python
37-
import purity_fb
65+
import purity_fb
3866
```
3967

4068
### Setuptools
@@ -56,7 +84,7 @@ import purity_fb
5684
Please follow the [installation procedure](#installation--usage) and then run the following:
5785

5886
```python
59-
from purity_fb import PurityFb, FileSystem, FileSystemPost, FileSystemSnapshot, SnapshotSuffix, rest
87+
from purity_fb import PurityFb, FileSystem, FileSystemSnapshot, SnapshotSuffix, rest
6088

6189
# create PurityFb object for a certain array
6290
fb = PurityFb("10.255.8.20")
@@ -67,7 +95,7 @@ try:
6795
fb.login("T-e7e551be-fe5d-4669-baf5-670cd8ea0560")
6896

6997
## manage file systems
70-
fs_obj = FileSystemPost(name="myfs", provisioned=50000)
98+
fs_obj = FileSystem(name="myfs", provisioned=50000)
7199
# create a file system named myfs
72100
fb.file_systems.create_file_systems(fs_obj)
73101
# list all existing file systems
@@ -249,6 +277,8 @@ at most 20 retries in total, among which at most 15 connection retries and at mo
249277
- [ArrayS3PerformanceResponse](docs/ArrayS3PerformanceResponse.md)
250278
- [ArraySpace](docs/ArraySpace.md)
251279
- [ArraySpaceResponse](docs/ArraySpaceResponse.md)
280+
- [Audit](docs/Audit.md)
281+
- [AuditResponse](docs/AuditResponse.md)
252282
- [Blade](docs/Blade.md)
253283
- [BladeResponse](docs/BladeResponse.md)
254284
- [Bucket](docs/Bucket.md)
@@ -338,8 +368,8 @@ at most 20 retries in total, among which at most 15 connection retries and at mo
338368
- [PolicyMemberWithRemoteResponse](docs/PolicyMemberWithRemoteResponse.md)
339369
- [PolicyObjects](docs/PolicyObjects.md)
340370
- [PolicyObjectsResponse](docs/PolicyObjectsResponse.md)
341-
- [PolicyReference](docs/PolicyReference.md)
342371
- [PolicyPatch](docs/PolicyPatch.md)
372+
- [PolicyReference](docs/PolicyReference.md)
343373
- [PolicyReferenceWithId](docs/PolicyReferenceWithId.md)
344374
- [PolicyResponse](docs/PolicyResponse.md)
345375
- [PolicyRule](docs/PolicyRule.md)

docs/ArrayConnectionsApi.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ This endpoint does not need any parameter.
122122
[[Back to top]](#) [[Back to API list]](index.md#endpoint-properties) [[Back to Model list]](index.md#documentation-for-models) [[Back to Overview]](index.md)
123123

124124
# **delete_array_connections**
125-
> delete_array_connections(name, ids=ids)
125+
> delete_array_connections(ids=ids, remote_ids=remote_ids, remote_names=remote_names)
126126
127127

128128

@@ -140,8 +140,8 @@ except rest.ApiException as e:
140140
print("Exception when logging in to the array: %s\n" % e)
141141
if res:
142142
try:
143-
# delete the keytab with the name 'my-connected-array'
144-
fb.array_connections.delete_array_connections(names=['my-connected-array'])
143+
# delete the array connection with the name 'my-connected-array'
144+
fb.array_connections.delete_array_connections(remote_names=['my-connected-array'])
145145

146146
# delete the array connection with id '10314f42-020d-7080-8013-000ddt400090'
147147
fb.array_connections.delete_array_connections(ids=['10314f42-020d-7080-8013-000ddt400090'])
@@ -153,8 +153,9 @@ if res:
153153

154154
Name | Type | Description | Notes
155155
------------- | ------------- | ------------- | -------------
156-
**name** | **str**| The name of the file system or snapshot to be updated. |
157156
**ids** | [**list[str]**](str.md)| A comma-separated list of resource IDs. This cannot be provided together with the name or names query parameters. | [optional]
157+
**remote_ids** | [**list[str]**](str.md)| A comma-separated list of remote array IDs. This cannot be provided together with the `remote_names` query parameter. | [optional]
158+
**remote_names** | [**list[str]**](str.md)| A comma-separated list of remote array names. This cannot be provided together with `remote_ids` query parameter. | [optional]
158159

159160
### Return type
160161

@@ -172,7 +173,7 @@ void (empty response body)
172173
[[Back to top]](#) [[Back to API list]](index.md#endpoint-properties) [[Back to Model list]](index.md#documentation-for-models) [[Back to Overview]](index.md)
173174

174175
# **list_array_connections**
175-
> ArrayConnectionResponse list_array_connections(filter=filter, ids=ids, limit=limit, names=names, sort=sort, start=start, token=token)
176+
> ArrayConnectionResponse list_array_connections(filter=filter, ids=ids, limit=limit, remote_ids=remote_ids, remote_names=remote_names, sort=sort, start=start, token=token)
176177
177178

178179

@@ -214,7 +215,8 @@ Name | Type | Description | Notes
214215
**filter** | **str**| The filter to be used for query. | [optional]
215216
**ids** | [**list[str]**](str.md)| A comma-separated list of resource IDs. This cannot be provided together with the name or names query parameters. | [optional]
216217
**limit** | **int**| limit, should be >= 0 | [optional]
217-
**names** | [**list[str]**](str.md)| A comma-separated list of resource names. This cannot be provided together with the ids query parameters. | [optional]
218+
**remote_ids** | [**list[str]**](str.md)| A comma-separated list of remote array IDs. This cannot be provided together with the `remote_names` query parameter. | [optional]
219+
**remote_names** | [**list[str]**](str.md)| A comma-separated list of remote array names. This cannot be provided together with `remote_ids` query parameter. | [optional]
218220
**sort** | **str**| The way to order the results. | [optional]
219221
**start** | **int**| start | [optional]
220222
**token** | **str**| token | [optional]
@@ -279,7 +281,7 @@ This endpoint does not need any parameter.
279281
[[Back to top]](#) [[Back to API list]](index.md#endpoint-properties) [[Back to Model list]](index.md#documentation-for-models) [[Back to Overview]](index.md)
280282

281283
# **list_array_connections_paths**
282-
> ArrayConnectionPathResponse list_array_connections_paths(filter=filter, ids=ids, limit=limit, names=names, sort=sort, start=start, token=token)
284+
> ArrayConnectionPathResponse list_array_connections_paths(filter=filter, ids=ids, limit=limit, remote_ids=remote_ids, remote_names=remote_names, sort=sort, start=start, token=token)
283285
284286

285287

@@ -321,7 +323,8 @@ Name | Type | Description | Notes
321323
**filter** | **str**| The filter to be used for query. | [optional]
322324
**ids** | [**list[str]**](str.md)| A comma-separated list of resource IDs. This cannot be provided together with the name or names query parameters. | [optional]
323325
**limit** | **int**| limit, should be >= 0 | [optional]
324-
**names** | [**list[str]**](str.md)| A comma-separated list of resource names. This cannot be provided together with the ids query parameters. | [optional]
326+
**remote_ids** | [**list[str]**](str.md)| A comma-separated list of remote array IDs. This cannot be provided together with the `remote_names` query parameter. | [optional]
327+
**remote_names** | [**list[str]**](str.md)| A comma-separated list of remote array names. This cannot be provided together with `remote_ids` query parameter. | [optional]
325328
**sort** | **str**| The way to order the results. | [optional]
326329
**start** | **int**| start | [optional]
327330
**token** | **str**| token | [optional]
@@ -342,7 +345,7 @@ Name | Type | Description | Notes
342345
[[Back to top]](#) [[Back to API list]](index.md#endpoint-properties) [[Back to Model list]](index.md#documentation-for-models) [[Back to Overview]](index.md)
343346

344347
# **list_array_connections_performance_replication**
345-
> RelationshipPerformanceReplicationResponse list_array_connections_performance_replication(end_time=end_time, filter=filter, ids=ids, limit=limit, names=names, resolution=resolution, sort=sort, start=start, start_time=start_time, token=token, total_only=total_only, type=type)
348+
> RelationshipPerformanceReplicationResponse list_array_connections_performance_replication(end_time=end_time, filter=filter, ids=ids, limit=limit, remote_ids=remote_ids, remote_names=remote_names, resolution=resolution, sort=sort, start=start, start_time=start_time, token=token, total_only=total_only, type=type)
346349
347350

348351

@@ -403,7 +406,8 @@ Name | Type | Description | Notes
403406
**filter** | **str**| The filter to be used for query. | [optional]
404407
**ids** | [**list[str]**](str.md)| A comma-separated list of resource IDs. This cannot be provided together with the name or names query parameters. | [optional]
405408
**limit** | **int**| limit, should be >= 0 | [optional]
406-
**names** | [**list[str]**](str.md)| A comma-separated list of resource names. This cannot be provided together with the ids query parameters. | [optional]
409+
**remote_ids** | [**list[str]**](str.md)| A comma-separated list of remote array IDs. This cannot be provided together with the `remote_names` query parameter. | [optional]
410+
**remote_names** | [**list[str]**](str.md)| A comma-separated list of remote array names. This cannot be provided together with `remote_ids` query parameter. | [optional]
407411
**resolution** | **int**| sample frequency in milliseconds | [optional] [default to 30000]
408412
**sort** | **str**| The way to order the results. | [optional]
409413
**start** | **int**| start | [optional]
@@ -428,7 +432,7 @@ Name | Type | Description | Notes
428432
[[Back to top]](#) [[Back to API list]](index.md#endpoint-properties) [[Back to Model list]](index.md#documentation-for-models) [[Back to Overview]](index.md)
429433

430434
# **update_array_connections**
431-
> ArrayConnectionResponse update_array_connections(name, array_connection, ids=ids)
435+
> ArrayConnectionResponse update_array_connections(array_connection, ids=ids, remote_ids=remote_ids, remote_names=remote_names)
432436
433437

434438

@@ -450,7 +454,7 @@ if res:
450454
replication_addresses=["10.202.101.71", "10.202.101.72"])
451455
try:
452456
# update the array connection named otherarray
453-
res = fb.array_connections.update_array_connections(names=["otherarray"], array_connection=new_attr)
457+
res = fb.array_connections.update_array_connections(remote_names=["otherarray"], array_connection=new_attr)
454458
print(res)
455459

456460
# update the array connection with id '10314f42-020d-7080-8013-000ddt400090'
@@ -465,9 +469,10 @@ if res:
465469

466470
Name | Type | Description | Notes
467471
------------- | ------------- | ------------- | -------------
468-
**name** | **str**| The name of the file system or snapshot to be updated. |
469472
**array_connection** | [**ArrayConnection**](ArrayConnection.md)| The attribute map used to update the array connection. |
470473
**ids** | [**list[str]**](str.md)| A comma-separated list of resource IDs. This cannot be provided together with the name or names query parameters. | [optional]
474+
**remote_ids** | [**list[str]**](str.md)| A comma-separated list of remote array IDs. This cannot be provided together with the `remote_names` query parameter. | [optional]
475+
**remote_names** | [**list[str]**](str.md)| A comma-separated list of remote array names. This cannot be provided together with `remote_ids` query parameter. | [optional]
471476

472477
### Return type
473478

docs/ArraysApi.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,9 @@ except rest.ApiException as e:
475475
print("Exception when logging in to the array: %s\n" % e)
476476
if res:
477477
try:
478+
# Rename the array to "example-name"
479+
# Set the NTP server to "0.example.ntp.server"
480+
# Change the array time zone to "America/Los_Angeles"
478481
array_settings = PureArray(name="example-name", ntp_servers=["0.example.ntp.server"],
479482
time_zone="America/Los_Angeles")
480483
res = fb.arrays.update_arrays(array_settings=array_settings)

docs/Audit.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Audit
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**id** | **str** | A non-modifiable, globally unique ID chosen by the system. | [optional]
7+
**name** | **str** | The name of the object (e.g., a file system or snapshot). | [optional]
8+
**arguments** | **str** | | [optional]
9+
**command** | **str** | | [optional]
10+
**ip_address** | **str** | | [optional]
11+
**subcommand** | **str** | | [optional]
12+
**time** | **int** | | [optional]
13+
**user** | **str** | | [optional]
14+
**user_agent** | **str** | | [optional]
15+
**user_interface** | **str** | The user interface through which the user session event was performed. Valid values are `CLI`, `GUI`, and `REST`. | [optional]
16+
17+
[[Back to Model list]](index.md#documentation-for-models) [[Back to API list]](index.md#endpoint-properties) [[Back to Overview]](index.md)
18+
19+

docs/AuditResponse.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# AuditResponse
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**pagination_info** | [**PaginationInfo**](PaginationInfo.md) | pagination information, only available in GET requests | [optional]
7+
**items** | [**list[Audit]**](Audit.md) | | [optional]
8+
9+
[[Back to Model list]](index.md#documentation-for-models) [[Back to API list]](index.md#endpoint-properties) [[Back to Overview]](index.md)
10+
11+

docs/AuditsApi.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# purity_fb_1dot9.AuditsApi
2+
3+
All URIs are relative to *https://purity_fb_server/api*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**list_audits**](AuditsApi.md#list_audits) | **GET** /1.9/audits |
8+
9+
10+
# **list_audits**
11+
> AuditResponse list_audits(filter=filter, ids=ids, limit=limit, names=names, sort=sort, start=start, token=token)
12+
13+
14+
15+
List audits.
16+
17+
### Example
18+
```python
19+
from purity_fb import PurityFb, rest
20+
21+
fb = PurityFb("10.255.9.28", version=__version__) # assume the array IP is 10.255.9.28
22+
fb.disable_verify_ssl()
23+
try:
24+
res = fb.login(API_TOKEN) # login to the array with your API_TOKEN
25+
except rest.ApiException as e:
26+
print("Exception when logging in to the array: %s\n" % e)
27+
if res:
28+
try:
29+
# list all audits
30+
res = fb.audits.list_audits()
31+
print(res)
32+
except rest.ApiException as e:
33+
print("Exception when listing audits: %s\n" % e)
34+
```
35+
36+
### Parameters
37+
38+
Name | Type | Description | Notes
39+
------------- | ------------- | ------------- | -------------
40+
**filter** | **str**| The filter to be used for query. | [optional]
41+
**ids** | [**list[str]**](str.md)| A comma-separated list of resource IDs. This cannot be provided together with the name or names query parameters. | [optional]
42+
**limit** | **int**| limit, should be >= 0 | [optional]
43+
**names** | [**list[str]**](str.md)| A comma-separated list of resource names. This cannot be provided together with the ids query parameters. | [optional]
44+
**sort** | **str**| The way to order the results. | [optional]
45+
**start** | **int**| start | [optional]
46+
**token** | **str**| token | [optional]
47+
48+
### Return type
49+
50+
[**AuditResponse**](AuditResponse.md)
51+
52+
### Authorization
53+
54+
[AuthTokenHeader](index.md#AuthTokenHeader)
55+
56+
### HTTP request headers
57+
58+
- **Content-Type**: application/json
59+
- **Accept**: application/json
60+
61+
[[Back to top]](#) [[Back to API list]](index.md#endpoint-properties) [[Back to Model list]](index.md#documentation-for-models) [[Back to Overview]](index.md)
62+

docs/BucketReplicaLinksApi.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ Update bucket replica links.
206206

207207
### Example
208208
```python
209-
from purity_fb import PurityFb, BucketReplicaLinkPost, ObjectStoreRemoteCredentials, rest
209+
from purity_fb import PurityFb, BucketReplicaLink, ObjectStoreRemoteCredentials, rest
210210

211211
fb = PurityFb("10.255.9.28", version=__version__) # assume the array IP is 10.255.9.28
212212
fb.disable_verify_ssl()
@@ -215,17 +215,20 @@ try:
215215
except rest.ApiException as e:
216216
print("Exception when logging in to the array: %s\n" % e)
217217
if res:
218-
# Update the paused status and remote credentials of a replica link
219-
new_attr = BucketReplicaLinkPost(paused=True, remote_credentials=ObjectStoreRemoteCredentials(name="remote/name"))
218+
# Pause an existing bucket replica link
219+
# Also change the remote credentials we're using for replication to the credentials named "remote/name"
220+
new_attr = BucketReplicaLink(paused=True, remote_credentials=ObjectStoreRemoteCredentials(name="remote/name"))
220221
try:
221-
# update the the replica link on the specified local bucket, to the specified remote bucket on the remote
222+
# Update the existing replica link on the specified local bucket, to the specified remote bucket on the remote
223+
# Use the attribute map from before to pause the link and change credentials
222224
res = fb.bucket_replica_links.update_bucket_replica_links(local_bucket_names=['localbucket'],
223225
remote_names=['remote'],
224226
remote_bucket_names=['remotebucket'],
225227
bucket_replica_link=new_attr)
226228
print(res)
227229

228-
# update the the replica link on the specified local bucket, to the specified remote bucket on the remote (by ids)
230+
# Update the existing replica link on the specified local bucket, to the specified remote bucket on the remote (by ids)
231+
# Use the attribute map from before to pause the link and change credentials
229232
res = fb.bucket_replica_links.update_bucket_replica_links(local_bucket_ids=['10314f42-020d-7080-8013-000ddt400090'],
230233
remote_ids=['10314f42-020d-7080-8013-000ddt400045'],
231234
remote_bucket_names=['remotebucket'],

docs/BucketsApi.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,14 @@ except rest.ApiException as e:
354354
print("Exception when logging in to the array: %s\n" % e)
355355
if res:
356356
try:
357-
# update the bucket object mybucket on the array
357+
# Destroy the bucket named "mybucket", and also suspend versioning
358358
res = fb.buckets.update_buckets(names=["mybucket"],
359-
bucket=BucketPatch(destroyed=True, versioning="enabled"))
359+
bucket=BucketPatch(destroyed=True, versioning="suspended"))
360+
361+
# Recover the bucket "mybucket", and also enable versioning
362+
res = fb.buckets.update_buckets(names=["mybucket"],
363+
bucket=BucketPatch(destroyed=False, versioning="enabled"))
364+
360365
print(res)
361366
except rest.ApiException as e:
362367
print("Exception when updating bucket: %s\n" % e)

0 commit comments

Comments
 (0)