purity_fb_1dot4.FileSystemsApi

All URIs are relative to https://purity_fb_server/api

Method HTTP request Description
create_file_systems POST /1.4/file-systems
delete_file_systems DELETE /1.4/file-systems
list_file_systems GET /1.4/file-systems
update_file_systems PATCH /1.4/file-systems

create_file_systems

FileSystemResponse create_file_systems(file_system)

Create a new file system

Example

from purity_fb import PurityFb, FileSystem, NfsRule, rest

fb = PurityFb("10.255.9.28", version=__version__) # assume the array IP is 10.255.9.28
fb.disable_verify_ssl()
try:
    res = fb.login(API_TOKEN) # login to the array with your API_TOKEN
except rest.ApiException as e:
    print("Exception when logging in to the array: %s\n" % e)
if res:
    # create a local file system object with given name, provisioned size, and NFS enabled.
    myfs = FileSystem(name="myfs", provisioned="5000", hard_limit_enabled=True, nfs=NfsRule(enabled=True))
    try:
        # post the file system object myfs on the array
        res = fb.file_systems.create_file_systems(file_system=myfs)
        print(res)
    except rest.ApiException as e:
        print("Exception when creating file system: %s\n" % e)

Parameters

Name Type Description Notes
file_system FileSystem the attribute map used to create the file system

Return type

FileSystemResponse

Authorization

AuthTokenHeader

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to Overview]

delete_file_systems

delete_file_systems(name)

Delete a file system by name

Example

from purity_fb import PurityFb, rest

fb = PurityFb("10.255.9.28", version=__version__) # assume the array IP is 10.255.9.28
fb.disable_verify_ssl()
try:
    res = fb.login(API_TOKEN) # login to the array with your API_TOKEN
except rest.ApiException as e:
    print("Exception when logging in to the array: %s\n" % e)
if res:
    try:
        # eradicate a file system with name myfs
        fb.file_systems.delete_file_systems(name="myfs")
    except rest.ApiException as e:
        print("Exception when deleting file system: %s\n" % e)

Parameters

Name Type Description Notes
name str name of the file system to be deleted

Return type

void (empty response body)

Authorization

AuthTokenHeader

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to Overview]

list_file_systems

FileSystemResponse list_file_systems(names=names, filter=filter, sort=sort, start=start, limit=limit, token=token, total=total, total_only=total_only)

List file systems

Example

from purity_fb import PurityFb, FileSystem, rest

fb = PurityFb("10.255.9.28", version=__version__) # assume the array IP is 10.255.9.28
fb.disable_verify_ssl()
try:
    res = fb.login(API_TOKEN) # login to the array with your API_TOKEN
except rest.ApiException as e:
    print("Exception when logging in to the array: %s\n" % e)
if res:
    try:
        # list all file systems
        fb.file_systems.list_file_systems()
        # list first five filesystems using default sort
        res = fb.file_systems.list_file_systems(limit=5)
        # list first five filesystems and sort by provisioned in descendant order
        res = fb.file_systems.list_file_systems(limit=5, sort="provisioned-")
        # list all remaining file systems
        res = fb.file_systems.list_file_systems(token=res.pagination_info.continuation_token)
        # list with filter
        res = fb.file_systems.list_file_systems(filter='name=\'myfs*\' and nfs.enabled and not(smb.enabled)')
    except rest.ApiException as e:
        print("Exception when listing file systems: %s\n" % e)

Parameters

Name Type Description Notes
names list[str] A list of names. [optional]
filter str The filter to be used for query. [optional]
sort str The way to order the results. [optional]
start int start [optional]
limit int limit, should be >= 0 [optional]
token str token [optional]
total bool return a total object in addition to the other results [optional] [default to false]
total_only bool return only the total object [optional] [default to false]

Return type

FileSystemResponse

Authorization

AuthTokenHeader

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to Overview]

update_file_systems

FileSystemResponse update_file_systems(name, attributes, ignore_usage=ignore_usage)

Update an existing file system

Example

from purity_fb import PurityFb, FileSystem, NfsRule, ProtocolRule, SmbRule, rest

fb = PurityFb("10.255.9.28", version=__version__) # assume the array IP is 10.255.9.28
fb.disable_verify_ssl()
try:
    res = fb.login(API_TOKEN) # login to the array with your API_TOKEN
except rest.ApiException as e:
    print("Exception when logging in to the array: %s\n" % e)
if res:
    # create a local file system object with provisioned size, and NFS enabled
    # note that name field should be None
    new_attr = FileSystem(provisioned="1024", hard_limit_enabled=True, nfs=NfsRule(enabled=True), http=ProtocolRule(enabled=False), smb=SmbRule(enabled=True, acl_mode="native"))
    try:
        # update the file system named myfs on the array
        res = fb.file_systems.update_file_systems(name="myfs", ignore_usage=True, attributes=new_attr)
        print(res)
    except rest.ApiException as e:
        print("Exception when updating file system: %s\n" % e)

Parameters

Name Type Description Notes
name str the name of the file system to be updated
attributes FileSystem the new attributes, only modifiable fields could be used.
ignore_usage bool Allow update operations that lead to a hard_limit_enabled file system with usage over its provisioned size. The update can be either setting hard_limit_enabled when usage is higher than provisioned size, or resize provisioned size to a value under usage when hard_limit_enabled is True. [optional]

Return type

FileSystemResponse

Authorization

AuthTokenHeader

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to Overview]