nisystemlink
0.1
  • Getting Started
  • API Reference
    • nisystemlink.clients.core
    • nisystemlink.clients.alarm
    • nisystemlink.clients.tag
    • nisystemlink.clients.product
    • nisystemlink.clients.testmonitor
    • nisystemlink.clients.dataframe
    • nisystemlink.clients.spec
    • nisystemlink.clients.file
      • FileClient
        • FileClient.__init__()
        • FileClient.api_info()
        • FileClient.get_files()
        • FileClient.query_files_linq()
        • FileClient.search_files()
        • FileClient.delete_file()
        • FileClient.delete_files()
        • FileClient.upload_file()
        • FileClient.download_file()
        • FileClient.update_metadata()
        • FileClient.start_upload_session()
        • FileClient.append_to_upload_session()
        • FileClient.finish_upload_session()
      • BaseFileRequest
        • BaseFileRequest.order_by_descending
        • BaseFileRequest.skip
        • BaseFileRequest.take
      • BaseFileResponse
        • BaseFileResponse.available_files
        • BaseFileResponse.total_count
      • FileLinqQueryOrderBy
      • FileLinqQueryRequest
        • FileLinqQueryRequest.filter
        • FileLinqQueryRequest.order_by
      • FileLinqQueryResponse
      • FileMetadata
        • FileMetadata.field_links
        • FileMetadata.last_updated_timestamp
        • FileMetadata.meta_data_revision
        • FileMetadata.path
      • FileQueryOrderBy
      • FileQueryResponse
        • FileQueryResponse.available_files
        • FileQueryResponse.field_links
        • FileQueryResponse.total_count
      • Link
        • Link.href
      • SearchFilesOrderBy
      • SearchFilesRequest
        • SearchFilesRequest.filter
        • SearchFilesRequest.order_by
      • SearchFilesResponse
      • TotalCount
        • TotalCount.relation
        • TotalCount.value
      • TotalCountRelation
        • TotalCountRelation.EQUALS
        • TotalCountRelation.GREATER_THAN_OR_EQUAL
      • UpdateMetadataRequest
        • UpdateMetadataRequest.expected_revision
        • UpdateMetadataRequest.properties
        • UpdateMetadataRequest.replace_existing
        • UpdateMetadataRequest.workspace
      • UploadSessionStartResponse
        • UploadSessionStartResponse.created_at
        • UploadSessionStartResponse.session_id
      • V1Operations
        • V1Operations.operations
    • nisystemlink.clients.notebook
    • nisystemlink.clients.feeds
    • nisystemlink.clients.assetmanagement
    • nisystemlink.clients.systems
    • nisystemlink.clients.work_item
    • nisystemlink.clients.test_plan
    • nisystemlink.clients.artifact
    • nisystemlink.clients.notification
    • Indices and tables
nisystemlink
  • API Reference
  • nisystemlink.clients.file
  • View page source

nisystemlink.clients.file

class nisystemlink.clients.file.FileClient(configuration=None)[source]
__init__(configuration=None)[source]

Initialize an instance.

Parameters

configuration (Optional[nisystemlink.clients.core.HttpConfiguration]) – Defines the web server to connect to and information about how to connect. If not provided, the HttpConfigurationManager is used to obtain the configuration.

Raises

ApiException – if unable to communicate with the File Service.

api_info()[source]

Get information about available API operations.

Return type

nisystemlink.clients.file.models.V1Operations

Returns

Information about available API operations.

Raises

ApiException – if unable to communicate with the File Service.

get_files(skip=0, take=0, order_by=None, order_by_descending=False, ids=None)[source]

Lists available files on the SystemLink File service. Use the skip and take parameters to return paged responses. The orderBy and orderByDescending fields can be used to manage sorting the list by metadata objects.

Parameters
  • skip (int) – How many files to skip in the result when paging. Defaults to 0.

  • take (int) – How many files to return in the result, or 0 to use a default defined by the service.

  • 0. (Defaults to) –

  • order_by (Optional[nisystemlink.clients.file.models.FileQueryOrderBy]) – The name of the metadata key to sort by. Defaults to None.

  • order_by_descending (Optional[bool]) – The elements in the list are sorted ascending if False

  • False. (and descending if True. Defaults to) –

  • ids (Optional[List[str]]) – List of file IDs to search by. Defaults to None.

Return type

nisystemlink.clients.file.models.FileQueryResponse

Returns

File Query Response

Raises

ApiException – if unable to communicate with the File Service.

query_files_linq(query)[source]

Queries file using LINQ filters.

Parameters

query (nisystemlink.clients.file.models.FileLinqQueryRequest) –

The LINQ query request containing the following parameters:

  • filter (str, optional): The filter criteria for files. Consists of a string of queries composed using AND/OR operators. String values and date strings need to be enclosed in double quotes. Parentheses can be used around filters to better define the order of operations.

    Filter syntax: [property name][operator][operand] and [property name][operator][operand]

    Operators:

    • Equals: x = y

    • Not equal: x != y

    • Greater than: x > y

    • Greater than or equal: x >= y

    • Less than: x < y

    • Less than or equal: x <= y

    • Logical AND: x and y or x && y

    • Logical OR: x or y or x || y

    • Contains: x.Contains(y) — checks if a list contains an element

    • Not Contains: !x.Contains(y) — checks if a list does not contain an element

    Valid file properties for filtering:

    • created: ISO timestamp string (e.g. "2023-01-01T08:00:00.000Z")

    • updated: ISO timestamp string (e.g. "2023-01-01T08:00:00.000Z")

    • extension: File extension (e.g. png, txt, pdf)

    • size: File size in bytes (e.g. 1024)

    • userId: User ID that created the file (e.g. "8abc4b87-07d4-4f84-b54f-48eec89b07d4")

    • properties: File properties (e.g. properties['x'] = 'y')

    • workspace: The workspace of the files (e.g. "88974b87-07d4-4f84-b54f-48eec89b11ed")

    Example:

    '(name = "myfile.txt" OR extension = "png")'
    ' and (DateTime(created) >'
    ' DateTime.parse("2023-01-01T08:00:00.000Z"))'
    ' and (size < 1024)'
    
  • order_by (nisystemlink.clients.file.models.FileLinqQueryOrderBy, optional): The file property to order results by. One of created, updated, extension, size, or workspace. Defaults to updated.

  • order_by_descending (bool, optional): Whether to return the files in descending order. Defaults to True.

  • skip (int, optional): How many files to skip in the result when paging. For example, a list of 100 files with a skip value of 50 will return entries starting from the 51st file. Defaults to 0.

  • take (int, optional): Maximum number of files to return. Defaults to 1000.

Return type

nisystemlink.clients.file.models.FileLinqQueryResponse

Returns

File Query Response

Raises

ApiException – if unable to communicate with the File Service.

search_files(request)[source]

Search for files based on filter criteria.

Note

This endpoint requires Elasticsearch to be configured in the SystemLink cluster. If Elasticsearch is not configured, this method will fail with an ApiException. For deployments without Elasticsearch, use query_files_linq() instead. You can call api_info() to check if the search_files operation is available in your deployment.

Parameters

request (nisystemlink.clients.file.models.SearchFilesRequest) – The search request containing filter, pagination, and sorting parameters.

Returns

Response containing matching files and total count.

Return type

SearchFilesResponse

Raises

ApiException – if unable to communicate with the File Service or if Elasticsearch is not configured in the cluster.

delete_file(id)[source]

Deletes the file indicated by the file_id.

Parameters

id (str) – The ID of the file.

Raises

ApiException – if unable to communicate with the File Service.

Return type

None

delete_files(ids)[source]

Delete multiple files.

Parameters

ids (List[str]) – List of unique IDs of Files.

Raises

ApiException – if unable to communicate with the File Service.

Return type

None

upload_file(file, metadata=None, id=None, workspace=None)[source]

Uploads a file to the File Service.

Parameters
  • file (BinaryIO) – The file to upload.

  • metadata (Optional[Dict[str, str]]) – File Metadata as dictionary.

  • id (Optional[str]) – Specify an unique (among all file) 24-digit Hex string ID of the file once it is uploaded. Defaults to None.

  • workspace (Optional[str]) – The id of the workspace the file belongs to. Defaults to None.

Return type

str

Returns

ID of uploaded file.

Raises

ApiException – if unable to communicate with the File Service.

download_file(id)[source]

Downloads a file from the SystemLink File service.

Parameters

id (str) – The ID of the file.

Yields

A file-like object for reading the exported data.

Raises

ApiException – if unable to communicate with the File Service.

Return type

nisystemlink.clients.core.helpers.IteratorFileLike

update_metadata(metadata, id)[source]

Updates an existing file’s metadata with the specified metadata properties.

Parameters
  • metadata (nisystemlink.clients.file.models.UpdateMetadataRequest) – File’s metadata and options for updating it.

  • id (str) – ID of the file to update Metadata.

Raises

ApiException – if unable to communicate with the File Service.

Return type

None

start_upload_session(workspace=None)[source]

Start an upload session for uploading a file in chunks.

Parameters

workspace (Optional[str]) – The id of the workspace the file belongs to. Defaults to None.

Return type

nisystemlink.clients.file.models.UploadSessionStartResponse

Returns

Upload session information including the session ID.

Raises

ApiException – if unable to communicate with the File Service.

append_to_upload_session(session_id, chunk_index, chunk, close=False)[source]

Append a chunk to an upload session.

The chunk needs to be 10485760 bytes (10 MB), unless the close parameter is true, which means that it is the last chunk of the file content. The chunks can be uploaded concurrently, as long as all chunk uploads are completed before finalizing.

Parameters
  • session_id (str) – The id of the upload session.

  • chunk_index (int) – The 1-based index of the chunk to be uploaded.

  • file – The chunk data to upload.

  • close (bool) – Set the current chunk as the last chunk to be uploaded. Defaults to False.

Raises

ApiException – if unable to communicate with the File Service.

Return type

None

finish_upload_session(session_id, name, properties)[source]

Finish an upload session and make the file visible in SystemLink.

This will trigger file events, such as routines.

Parameters
  • session_id (str) – The id of the upload session.

  • name (str) – The name of the file.

  • properties (Dict[str, str]) – The properties of the file.

Return type

str

Returns

ID of the uploaded file.

Raises

ApiException – if unable to communicate with the File Service.

pydantic model nisystemlink.clients.file.models.BaseFileRequest[source]

Base class for file request models containing common query parameters.

Show JSON schema
{
   "title": "BaseFileRequest",
   "description": "Base class for file request models containing common query parameters.",
   "type": "object",
   "properties": {
      "skip": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Skip"
      },
      "take": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Take"
      },
      "orderByDescending": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": false,
         "title": "Orderbydescending"
      }
   }
}

Fields
  • order_by_descending

  • skip

  • take

field order_by_descending: Optional[bool] = False

Whether to sort in descending order.

field skip: Optional[int] = None

How many files to skip in the result when paging.

field take: Optional[int] = None

How many files to return in the result.

pydantic model nisystemlink.clients.file.models.BaseFileResponse[source]

Base class for file response models containing a list of files and total count.

Show JSON schema
{
   "title": "BaseFileResponse",
   "description": "Base class for file response models containing a list of files and total count.",
   "type": "object",
   "properties": {
      "availableFiles": {
         "items": {
            "$ref": "#/$defs/LinqQueryFileMetadata"
         },
         "title": "Availablefiles",
         "type": "array"
      },
      "totalCount": {
         "$ref": "#/$defs/TotalCount"
      }
   },
   "$defs": {
      "LinqQueryFileMetadata": {
         "description": "Metadata for a file returned by a LINQ query.",
         "properties": {
            "created": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Created"
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Id"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Properties"
            },
            "serviceGroup": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Servicegroup"
            },
            "size": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Size"
            },
            "size64": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Size64"
            },
            "workspace": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Workspace"
            },
            "updated": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Updated"
            }
         },
         "title": "LinqQueryFileMetadata",
         "type": "object"
      },
      "TotalCount": {
         "description": "The total number of files that match the query regardless of skip and take values",
         "properties": {
            "relation": {
               "$ref": "#/$defs/TotalCountRelation"
            },
            "value": {
               "title": "Value",
               "type": "integer"
            }
         },
         "required": [
            "relation",
            "value"
         ],
         "title": "TotalCount",
         "type": "object"
      },
      "TotalCountRelation": {
         "description": "Describes the relation the returned total count value has with respect to the total number of files.",
         "enum": [
            "eq",
            "gte"
         ],
         "title": "TotalCountRelation",
         "type": "string"
      }
   },
   "required": [
      "availableFiles",
      "totalCount"
   ]
}

Fields
  • available_files

  • total_count

field available_files: List[LinqQueryFileMetadata] [Required]

The list of files returned by the query

field total_count: TotalCount [Required]

The total number of files that match the query regardless of skip and take values

class nisystemlink.clients.file.models.FileLinqQueryOrderBy(value)[source]

Order Files LINQ Query by Metadata for POST /query-files-linq endpoint.

pydantic model nisystemlink.clients.file.models.FileLinqQueryRequest[source]

Request model for LINQ query operations.

Show JSON schema
{
   "title": "FileLinqQueryRequest",
   "description": "Request model for LINQ query operations.",
   "type": "object",
   "properties": {
      "skip": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Skip"
      },
      "take": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Take"
      },
      "orderByDescending": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": false,
         "title": "Orderbydescending"
      },
      "filter": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Filter"
      },
      "orderBy": {
         "anyOf": [
            {
               "$ref": "#/$defs/FileLinqQueryOrderBy"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      }
   },
   "$defs": {
      "FileLinqQueryOrderBy": {
         "description": "Order Files LINQ Query by Metadata for POST /query-files-linq endpoint.",
         "enum": [
            "name",
            "created",
            "updated",
            "extension",
            "size",
            "workspace"
         ],
         "title": "FileLinqQueryOrderBy",
         "type": "string"
      }
   }
}

Fields
  • filter

  • order_by

field filter: Optional[str] = None

The filter criteria for files. Consists of a string of queries composed using AND/OR operators. String values and date strings need to be enclosed in double quotes. Parentheses can be used around filters to better define the order of operations. Example Filter syntax: ‘[property name][operator][operand] and [property name][operator][operand]’

field order_by: Optional[FileLinqQueryOrderBy] = None

The property by which to order the files in the response.

pydantic model nisystemlink.clients.file.models.FileLinqQueryResponse[source]

Response model for LINQ query operations.

Show JSON schema
{
   "title": "FileLinqQueryResponse",
   "description": "Response model for LINQ query operations.",
   "type": "object",
   "properties": {
      "availableFiles": {
         "items": {
            "$ref": "#/$defs/LinqQueryFileMetadata"
         },
         "title": "Availablefiles",
         "type": "array"
      },
      "totalCount": {
         "$ref": "#/$defs/TotalCount"
      }
   },
   "$defs": {
      "LinqQueryFileMetadata": {
         "description": "Metadata for a file returned by a LINQ query.",
         "properties": {
            "created": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Created"
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Id"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Properties"
            },
            "serviceGroup": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Servicegroup"
            },
            "size": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Size"
            },
            "size64": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Size64"
            },
            "workspace": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Workspace"
            },
            "updated": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Updated"
            }
         },
         "title": "LinqQueryFileMetadata",
         "type": "object"
      },
      "TotalCount": {
         "description": "The total number of files that match the query regardless of skip and take values",
         "properties": {
            "relation": {
               "$ref": "#/$defs/TotalCountRelation"
            },
            "value": {
               "title": "Value",
               "type": "integer"
            }
         },
         "required": [
            "relation",
            "value"
         ],
         "title": "TotalCount",
         "type": "object"
      },
      "TotalCountRelation": {
         "description": "Describes the relation the returned total count value has with respect to the total number of files.",
         "enum": [
            "eq",
            "gte"
         ],
         "title": "TotalCountRelation",
         "type": "string"
      }
   },
   "required": [
      "availableFiles",
      "totalCount"
   ]
}

Fields

pydantic model nisystemlink.clients.file.models.FileMetadata[source]

Show JSON schema
{
   "title": "FileMetadata",
   "type": "object",
   "properties": {
      "created": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Created"
      },
      "id": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Id"
      },
      "properties": {
         "anyOf": [
            {
               "additionalProperties": {
                  "type": "string"
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Properties"
      },
      "serviceGroup": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Servicegroup"
      },
      "size": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Size"
      },
      "size64": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Size64"
      },
      "workspace": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Workspace"
      },
      "_links": {
         "anyOf": [
            {
               "additionalProperties": {
                  "$ref": "#/$defs/Link"
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Links"
      },
      "path": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Path"
      },
      "metaDataRevision": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Metadatarevision"
      },
      "lastUpdatedTimestamp": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Lastupdatedtimestamp"
      }
   },
   "$defs": {
      "Link": {
         "properties": {
            "href": {
               "examples": [
                  "/nifile/v1/service-groups"
               ],
               "title": "Href",
               "type": "string"
            }
         },
         "required": [
            "href"
         ],
         "title": "Link",
         "type": "object"
      }
   }
}

Fields
  • field_links

  • last_updated_timestamp

  • meta_data_revision

  • path

field field_links: Optional[Dict[str, Link]] = None

The links to access and manipulate the file: - data: Link to download the file using a GET request - delete: Link to delete the file using a DELETE request - self: Link to the file’s metadata - updateMetadata: Link to update the file’s metadata using a POST request

field last_updated_timestamp: Optional[datetime] = None

The date and time the file was last updated in the file service.

example: 2018-05-15T18:54:27.519Z

field meta_data_revision: Optional[int] = None

The file’s properties revision number. When a file is uploaded, the revision number starts at 1. Every time metadata is updated, the revision number is incremented by 1.

field path: Optional[str] = None

The path to the file on the server. This field is returned only if the user has associated privileges to view file paths.

example: C: empafb2ce3741fe11d88838cc9.txt

class nisystemlink.clients.file.models.FileQueryOrderBy(value)[source]

Order Files Query Response by Metadata for GET /files endpoint.

pydantic model nisystemlink.clients.file.models.FileQueryResponse[source]

The result of a file query

Show JSON schema
{
   "title": "FileQueryResponse",
   "description": "The result of a file query",
   "type": "object",
   "properties": {
      "_links": {
         "additionalProperties": {
            "$ref": "#/$defs/Link"
         },
         "title": "Links",
         "type": "object"
      },
      "availableFiles": {
         "items": {
            "$ref": "#/$defs/FileMetadata"
         },
         "title": "Availablefiles",
         "type": "array"
      },
      "totalCount": {
         "title": "Totalcount",
         "type": "integer"
      }
   },
   "$defs": {
      "FileMetadata": {
         "properties": {
            "created": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Created"
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Id"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Properties"
            },
            "serviceGroup": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Servicegroup"
            },
            "size": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Size"
            },
            "size64": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Size64"
            },
            "workspace": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Workspace"
            },
            "_links": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/Link"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Links"
            },
            "path": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Path"
            },
            "metaDataRevision": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Metadatarevision"
            },
            "lastUpdatedTimestamp": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Lastupdatedtimestamp"
            }
         },
         "title": "FileMetadata",
         "type": "object"
      },
      "Link": {
         "properties": {
            "href": {
               "examples": [
                  "/nifile/v1/service-groups"
               ],
               "title": "Href",
               "type": "string"
            }
         },
         "required": [
            "href"
         ],
         "title": "Link",
         "type": "object"
      }
   },
   "required": [
      "_links",
      "availableFiles",
      "totalCount"
   ]
}

Fields
  • available_files

  • field_links

  • total_count

field available_files: List[FileMetadata] [Required]

The list of files returned by the query

field field_links: Dict[str, Link] [Required]

The links that apply to the collection of files for a service group: - deleteFiles: Link to delete multiple files from the service group using a POST - query: Link to query for available files in the service group using a POST - search: Link to retrieve a filtered list of files in the service group using a GET - self: Link to the current service group - upload: Link to upload files to the service group using a POST

field total_count: int [Required]

The total number of files that match the query regardless of skip and take values

pydantic model nisystemlink.clients.file.models.Link[source]

Show JSON schema
{
   "title": "Link",
   "type": "object",
   "properties": {
      "href": {
         "examples": [
            "/nifile/v1/service-groups"
         ],
         "title": "Href",
         "type": "string"
      }
   },
   "required": [
      "href"
   ]
}

Fields
  • href

field href: str [Required]

URI of the link

class nisystemlink.clients.file.models.SearchFilesOrderBy(value)[source]

Order Files Search by Metadata for POST /search-files endpoint.

pydantic model nisystemlink.clients.file.models.SearchFilesRequest[source]

Request model for searching files.

Show JSON schema
{
   "title": "SearchFilesRequest",
   "description": "Request model for searching files.",
   "type": "object",
   "properties": {
      "skip": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Skip"
      },
      "take": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Take"
      },
      "orderByDescending": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": false,
         "title": "Orderbydescending"
      },
      "filter": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Filter"
      },
      "orderBy": {
         "anyOf": [
            {
               "$ref": "#/$defs/SearchFilesOrderBy"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      }
   },
   "$defs": {
      "SearchFilesOrderBy": {
         "description": "Order Files Search by Metadata for POST /search-files endpoint.",
         "enum": [
            "name",
            "created",
            "updated",
            "extension",
            "size",
            "workspace"
         ],
         "title": "SearchFilesOrderBy",
         "type": "string"
      }
   }
}

Fields
  • filter

  • order_by

field filter: Optional[str] = None

The filter criteria for files using Lucene query syntax. Consists of a string of queries composed using AND/OR operators. String values and date strings need to be enclosed in double quotes. Parentheses can be used around filters to better define the order of operations. Example Filter syntax: ‘[property name]:[operand] AND [property name]:[operand]’

field order_by: Optional[SearchFilesOrderBy] = None

The property by which to order the files in the response.

pydantic model nisystemlink.clients.file.models.SearchFilesResponse[source]

Response model for search files operation.

Show JSON schema
{
   "title": "SearchFilesResponse",
   "description": "Response model for search files operation.",
   "type": "object",
   "properties": {
      "availableFiles": {
         "items": {
            "$ref": "#/$defs/LinqQueryFileMetadata"
         },
         "title": "Availablefiles",
         "type": "array"
      },
      "totalCount": {
         "$ref": "#/$defs/TotalCount"
      }
   },
   "$defs": {
      "LinqQueryFileMetadata": {
         "description": "Metadata for a file returned by a LINQ query.",
         "properties": {
            "created": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Created"
            },
            "id": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Id"
            },
            "properties": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Properties"
            },
            "serviceGroup": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Servicegroup"
            },
            "size": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Size"
            },
            "size64": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Size64"
            },
            "workspace": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Workspace"
            },
            "updated": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Updated"
            }
         },
         "title": "LinqQueryFileMetadata",
         "type": "object"
      },
      "TotalCount": {
         "description": "The total number of files that match the query regardless of skip and take values",
         "properties": {
            "relation": {
               "$ref": "#/$defs/TotalCountRelation"
            },
            "value": {
               "title": "Value",
               "type": "integer"
            }
         },
         "required": [
            "relation",
            "value"
         ],
         "title": "TotalCount",
         "type": "object"
      },
      "TotalCountRelation": {
         "description": "Describes the relation the returned total count value has with respect to the total number of files.",
         "enum": [
            "eq",
            "gte"
         ],
         "title": "TotalCountRelation",
         "type": "string"
      }
   },
   "required": [
      "availableFiles",
      "totalCount"
   ]
}

Fields

pydantic model nisystemlink.clients.file.models.TotalCount[source]

The total number of files that match the query regardless of skip and take values

Show JSON schema
{
   "title": "TotalCount",
   "description": "The total number of files that match the query regardless of skip and take values",
   "type": "object",
   "properties": {
      "relation": {
         "$ref": "#/$defs/TotalCountRelation"
      },
      "value": {
         "title": "Value",
         "type": "integer"
      }
   },
   "$defs": {
      "TotalCountRelation": {
         "description": "Describes the relation the returned total count value has with respect to the total number of files.",
         "enum": [
            "eq",
            "gte"
         ],
         "title": "TotalCountRelation",
         "type": "string"
      }
   },
   "required": [
      "relation",
      "value"
   ]
}

Fields
  • relation

  • value

field relation: TotalCountRelation [Required]

Describes the relation the returned total count value has with respect to the total number of files matched by the query.

field value: int [Required]

Describes the number of files that were returned as a result of the query in the database

class nisystemlink.clients.file.models.TotalCountRelation(value)[source]

Describes the relation the returned total count value has with respect to the total number of files.

EQUALS = 'eq'

Equals, meaning that the returned items are all the items that matched the filter.

GREATER_THAN_OR_EQUAL = 'gte'

Greater or equal, meaning that the take limit has been hit, but there are further items that match the query.

pydantic model nisystemlink.clients.file.models.UpdateMetadataRequest[source]

The file’s metadata and options for updating it.

Show JSON schema
{
   "title": "UpdateMetadataRequest",
   "description": "The file's metadata and options for updating it.",
   "type": "object",
   "properties": {
      "replaceExisting": {
         "title": "Replaceexisting",
         "type": "boolean"
      },
      "expectedRevision": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Expectedrevision"
      },
      "properties": {
         "type": "object",
         "additionalProperties": {
            "type": "string"
         },
         "title": "Properties"
      },
      "workspace": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Workspace"
      }
   },
   "required": [
      "replaceExisting",
      "properties"
   ]
}

Fields
  • expected_revision

  • properties

  • replace_existing

  • workspace

field expected_revision: Optional[int] = None

When specified, this is an integer that should be set to match the last known revision number of the metadata. If it doesn’t match at the time of execution, the update request will be rejected. This is used to ensure that changes to this file metadata are correctly using the previous state.

field properties: Dict[str, str] [Required]

The properties to set. A map of key value properties containing the metadata to be attached.

Predefined:

Name: This is an optional property for renaming the file. When specified, the file will be renamed.

field replace_existing: bool [Required]

Determines whether the current list should be entirely replaced by the specified list or merged with the existing list.

field workspace: Optional[str] = None

When specified, the workspace of the metadata will be updated to the new value.

pydantic model nisystemlink.clients.file.models.UploadSessionStartResponse[source]

Response model for starting an upload session.

Show JSON schema
{
   "title": "UploadSessionStartResponse",
   "description": "Response model for starting an upload session.",
   "type": "object",
   "properties": {
      "id": {
         "title": "Id",
         "type": "string"
      },
      "createdAt": {
         "format": "date-time",
         "title": "Createdat",
         "type": "string"
      }
   },
   "required": [
      "id",
      "createdAt"
   ]
}

Fields
  • created_at

  • session_id

field created_at: datetime [Required]

The date and time the upload session has started.

field session_id: str [Required]

The id created for the upload session.

pydantic model nisystemlink.clients.file.models.V1Operations[source]

Show JSON schema
{
   "title": "V1Operations",
   "type": "object",
   "properties": {
      "operations": {
         "anyOf": [
            {
               "$ref": "#/$defs/Operations"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      }
   },
   "$defs": {
      "Operation": {
         "description": "Represents an operation that can be performed on a data frame.",
         "properties": {
            "available": {
               "title": "Available",
               "type": "boolean"
            },
            "version": {
               "title": "Version",
               "type": "integer"
            }
         },
         "required": [
            "available",
            "version"
         ],
         "title": "Operation",
         "type": "object"
      },
      "Operations": {
         "properties": {
            "deleteFiles": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Operation"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "downloadData": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Operation"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "listFiles": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Operation"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "queryFiles": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Operation"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "searchFiles": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Operation"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "updateMetadata": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Operation"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "uploadFiles": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Operation"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "title": "Operations",
         "type": "object"
      }
   }
}

Fields
  • operations

field operations: Optional[Operations] = None

Available operations in the v1 version of the API: - deleteFiles: The ability to delete uploaded files - downloadData: The ability to download file data - listFiles: The ability to list available files and service groups - queryFiles: The ability to query available files and service groups - searchFiles: The ability to search for files using Elasticsearch - updateMetadata: The ability to update file metadata properties - uploadFiles: The ability to upload files

Previous Next

© Copyright 2020, National Instruments.

Built with Sphinx using a theme provided by Read the Docs.