-
Notifications
You must be signed in to change notification settings - Fork 29
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 #68 from rlucan-ps/fb-restapi-2-11
Release 1.41.0 Added FlashBlade REST 2.11
- Loading branch information
Showing
647 changed files
with
110,738 additions
and
701 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,26 @@ | ||
from pypureclient.flashblade import Eula, EulaSignature | ||
|
||
# Update the EULA with eula body parameter | ||
# The fields 'name', 'title', 'company' are no longer required, but are still accepted and will be ignored. | ||
|
||
signature = EulaSignature(name="example name", title="example", company="one company") | ||
eula_body = Eula(signature=signature) | ||
res = client.patch_arrays_eula(eula=eula_body) | ||
print(res) | ||
if type(res) == pypureclient.responses.ValidResponse: | ||
print(list(res.items)) | ||
|
||
# Update the EULA with eula empty body parameter | ||
# eula body with empty signature are still accepted, but will be ignored. | ||
signature = EulaSignature() | ||
eula_body = Eula(signature=signature) | ||
res = client.patch_arrays_eula(eula=eula_body) | ||
print(res) | ||
if type(res) == pypureclient.responses.ValidResponse: | ||
print(list(res.items)) | ||
|
||
# Update the EULA with no parameter | ||
res = client.patch_arrays_eula() | ||
print(res) | ||
if type(res) == pypureclient.responses.ValidResponse: | ||
print(list(res.items)) |
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,24 @@ | ||
from pypureclient.flashblade import SmbClientPolicy, SmbClientPolicyRule | ||
|
||
# Bulk specify a new rule for the policy. | ||
# Note: The rules must be ordered by client type grouped by | ||
# IP addresses, (hostname, FQDN, netmasks), and asterisk (*). | ||
bulk_rules = [ | ||
SmbClientPolicyRule(client='*', permission='ro', encryption='required') | ||
] | ||
policy_attr = SmbClientPolicy(rules=bulk_rules) | ||
res = client.patch_smb_client_policies(names=["client_policy_1"], policy=policy_attr) | ||
print(res) | ||
if type(res) == pypureclient.responses.ValidResponse: | ||
print(list(res.items)) | ||
|
||
# update the smb client policy with id '83efe671-3265-af1e-6dd2-c9ff155c2a18' | ||
res = client.patch_smb_client_policies(ids=['83efe671-3265-af1e-6dd2-c9ff155c2a18'], | ||
policy=policy_attr) | ||
print(res) | ||
if type(res) == pypureclient.responses.ValidResponse: | ||
res_items = (list(res.items)) | ||
print(res_items) | ||
|
||
# Other valid fields: ids | ||
# See section "Common Fields" for examples |
43 changes: 43 additions & 0 deletions
43
docs/source/examples/FB2.11/patch_smb_client_policies_rules.py
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,43 @@ | ||
from pypureclient.flashblade import SmbClientPolicyRule | ||
|
||
policyname = 'client_policy_1' | ||
|
||
# Patch client policy rule 'client_policy_1.1' in client policy named 'client_policy_1' | ||
res = client.patch_smb_client_policies_rules(names=[policyname+'.1'], | ||
rule=SmbClientPolicyRule(permission='ro', encryption='required')) | ||
|
||
print(res) | ||
if type(res) == pypureclient.responses.ValidResponse: | ||
print(list(res.items)) | ||
|
||
# Patch a policy by name with a version specifier. | ||
# The Patch will fail if the policy version differs from specified version. | ||
policy_version = '00000000-7b11-a468-0000-0000503669ea' | ||
res = client.patch_smb_client_policies_rules(names=[policyname+'.1'], | ||
rule=SmbClientPolicyRule(permission='ro', encryption='required'), | ||
versions=[policy_version]) | ||
|
||
print(res) | ||
if type(res) == pypureclient.responses.ValidResponse: | ||
print(list(res.items)) | ||
|
||
# Insert or Move a rule client_policy_1.1 rule before 'client_policy_1.2` in client policy named 'client_policy_1' | ||
res = client.patch_smb_client_policies_rules(names=[policyname+'.1'], | ||
before_rule_name=[policyname+'.2'], | ||
rule=SmbClientPolicyRule(permission='ro', encryption='required')) | ||
|
||
print(res) | ||
if type(res) == pypureclient.responses.ValidResponse: | ||
print(list(res.items)) | ||
|
||
# Insert or Move a rule 'client_policy_1.1` before rule id `10314f42-020d-7080-8013-000ddt400012` in client policy named 'client_policy_1' | ||
res = client.patch_smb_client_policies_rules(names=[policyname+'.1'], | ||
before_rule_id=["10314f42-020d-7080-8013-000ddt400012"], | ||
rule=SmbClientPolicyRule(permission='ro', encryption='required')) | ||
|
||
print(res) | ||
if type(res) == pypureclient.responses.ValidResponse: | ||
print(list(res.items)) | ||
|
||
# Other valid fields: ids | ||
# See section "Common Fields" for examples |
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,12 @@ | ||
from pypureclient.flashblade import SmbClientPolicy, SmbClientPolicyRule | ||
|
||
# Create a client policy with a rule which allows Read (but no other) permissions and | ||
# requires encryption for everyone. | ||
policyname = 'client_policy_1' | ||
policy = SmbClientPolicy() | ||
policy.rules = [SmbClientPolicyRule(client='*', permission='ro', encryption='required')] | ||
|
||
res = client.post_smb_client_policies(names=[policyname], policy=policy) | ||
print(res) | ||
if type(res) == pypureclient.responses.ValidResponse: | ||
print(list(res.items)) |
32 changes: 32 additions & 0 deletions
32
docs/source/examples/FB2.11/post_smb_client_policies_rules.py
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,32 @@ | ||
from pypureclient.flashblade import SmbClientPolicyRule | ||
|
||
policyname = 'client_policy_1' | ||
|
||
# Create a new client policy rule in the client policy named 'client_policy_1' | ||
# with specified client, permission, and encryption | ||
res = client.post_smb_client_policies_rules(policy_names=[policyname], | ||
rule=SmbClientPolicyRule(client='*', permission='ro', encryption='required')) | ||
|
||
# Insert or Move a policy by name with a version specifier. | ||
# The Post will fail if the policy version differs from specified version. | ||
policy_version = '00000000-7b11-a468-0000-0000503669ea' | ||
res = client.post_smb_client_policies_rules(policy_names=[policyname], | ||
rule=SmbClientPolicyRule(client='*', permission='ro', encryption='required'), | ||
versions=[policy_version]) | ||
|
||
# Insert or Move a rule client_policy_1.1 rule before 'client_policy_1.2` in client policy named 'client_policy_1' | ||
res = client.post_smb_client_policies_rules(before_rule_name=[policyname+'.2'], | ||
policy_names=[policyname], | ||
rule=SmbClientPolicyRule(client='*', permission='ro', encryption='required')) | ||
|
||
# Insert or Move a rule 'client_policy_1.1` before rule id `10314f42-020d-7080-8013-000ddt400012` in client policy named 'client_policy_1' | ||
res = client.post_smb_client_policies_rules(before_rule_id=["10314f42-020d-7080-8013-000ddt400012"], | ||
policy_names=[policyname], | ||
rule=SmbClientPolicyRule(client='*', permission='ro', encryption='required')) | ||
|
||
print(res) | ||
if type(res) == pypureclient.responses.ValidResponse: | ||
print(list(res.items)) | ||
|
||
# Other valid fields: policy_ids | ||
# See section "Common Fields" for examples |
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
Oops, something went wrong.