|
Seismic Drive Client API
|
Seismic Drive Utilities class. More...
#include <SDUtils.h>
Public Member Functions | |
| SDUtils (SDManager *sdmanager) | |
| Constructor. More... | |
| ~SDUtils () | |
| SDUtils (SDUtils &&rhf) noexcept | |
| Move Constructor. More... | |
| SDUtils & | operator= (SDUtils &&rhf) noexcept |
| Move Assignment Operator. More... | |
| SDUtils (const SDUtils &rhs) | |
| Copy Constructor. More... | |
| SDUtils & | operator= (const SDUtils &rhs) |
| Copy Assignment Operator. More... | |
| std::vector< bool > | datasetsExist (const std::vector< std::string > &sdfileNames) |
| Checks for existance of several files. More... | |
| bool | datasetExist (const std::string &fileName) |
| Deprecated. More... | |
| bool | datasetExists (const std::string &fileName) |
| Checks for existance of a file. More... | |
| std::vector< int64_t > | datasetsSize (const std::vector< std::string > &sdfileNames) |
| Deprecated. More... | |
| std::vector< int64_t > | datasetSizes (const std::vector< std::string > &sdfileNames) |
| Get the file size in bytes of several files. More... | |
| int64_t | datasetSize (const std::string &fileName) |
| Get the file size in bytes. More... | |
| void | deleteDataset (const std::string &sddatasetname) |
| Delete a dataset (objects removed via service) More... | |
| void | deleteDatasetSync (const std::string &datasetUri) |
| Delete a dataset (objects removed via sdk) More... | |
| bool | blockExists (const std::string &datasetpath, int blocknum) const |
| Determines whether a block of data exists in a dataset. More... | |
| bool | blockExists (const std::string &datasetpath, const std::string &blockName) const |
| Determines whether a block of data exists in a dataset. More... | |
| std::vector< std::vector< std::string > > | readDirectory (const std::string &sddirectorypath) const |
| List Datasets and directories in a directory. More... | |
| std::pair< std::vector< std::string >, std::vector< std::string > > | ls (const std::string &path, std::string &cursor, int limit=10000) const |
| list datasets and directories content of a seismic store path. More... | |
| std::vector< std::string > | datasetList (const std::string &subProjectPath, std::string &cursor, int limit=100) const |
| list datasets of a seismic store subProjectPath. More... | |
| std::string | bulkDelete (const std::string &path) const |
| Add a bulk delete request to the operation task queue. More... | |
| std::string | bulkDeleteSubProjectPath (std::string &subProjectPath) const |
| Add a bulk delete request to the operation task queue. More... | |
| std::string | bulkDeleteDataset (std::string &datasetPath) const |
| Add a bulk delete request to the operation task queue. More... | |
| BulkDeleteStatus | bulkDeleteStatus (const std::string &operationId, const std::string &dataPartitionId) const |
| Get the status of a bulk delete operation. More... | |
| std::string | bulkChangeTier (const std::string &path, const std::string &storageTier) const |
| Add a bulk change-tier request to the operation task queue. More... | |
| std::string | bulkChangeTierSubProjectPath (std::string &subProjectPath, const std::string &storageTier) const |
| Add a bulk change-tier request to the operation task queue. More... | |
| std::string | bulkChangeTierDataset (std::string &datasetPath, const std::string &storageTier) const |
| Add a bulk change-tier request to the operation task queue. More... | |
| BulkChangeTierStatus | bulkChangeTierStatus (const std::string &operationId, const std::string &dataPartitionId) const |
| Get the status of a bulk change-tier operation. More... | |
| std::string | getServiceCloudProivider () const |
| Returns the current cloud provider. More... | |
| void | upload (const std::string &datasetpath, const std::string &filename) const |
| std::string | getCreatedDate (const std::string &seistoreDatasetPath) const |
| Get dataset created date. More... | |
| std::string | getLastModifiedDate (const std::string &seistoreDatasetPath) const |
| Get dataset last modified date. More... | |
| std::string | getCreatedBy (const std::string &seistoreDatasetPath) const |
| Get dataset "create by". More... | |
| std::string | getType (const std::string &seistoreDatasetPath) const |
| Get dataset type. More... | |
| std::string | getLegalTag (const std::string &seistoreDatasetPath) const |
| Get dataset legal-tag. More... | |
| std::string | getFileMetaData (const std::string &seistoreDatasetPath) const |
| Gets the user-defined filemetadata of the current dataset. More... | |
| void | datasetUnlock (const std::string &seistoreDatasetPath) const |
| Unlock a dataset. More... | |
| std::string | getOpenSessionID (const std::string &seistoreDatasetPath) const |
| Get the dataset open session id. More... | |
| bool | updateStorageTier (const std::string &sdpath, const std::string &storageTier) const |
Static Public Member Functions | |
| static bool | isSDDatasetPath (const std::string &datasetpath) |
| Check if a dataset path is a valid seismic-store dataset path. More... | |
Friends | |
| class | SDUtilsTest |
Seismic Drive Utilities class.
This class is the utilities class for the seismic-drive namespace.
| seismicdrive::SDUtils::SDUtils | ( | SDManager * | sdmanager | ) |
Constructor.
| sdmanager | is the seismic drive service manager |
| seismicdrive::SDUtils::~SDUtils | ( | ) |
Destructor.
If the file is opened for writing (not READ_ONLY), it will be closed.
|
noexcept |
Move Constructor.
This contructor moves the SDUtils object from the source to the new object and destroy the source object.
| seismicdrive::SDUtils::SDUtils | ( | const SDUtils & | rhs | ) |
Copy Constructor.
This contructor makes a copy of the SDUtils object from the source to the new object without modifying the source object.
| bool seismicdrive::SDUtils::blockExists | ( | const std::string & | datasetpath, |
| int | blocknum | ||
| ) | const |
Determines whether a block of data exists in a dataset.
This method determines whether a block of data (specified with a block number) exists in a dataset.
| datasetpath | is the seismic drive dataset name ( sd://tenant/subproject/path/dataset ) |
| blocknum | is the number of the block |
| bool seismicdrive::SDUtils::blockExists | ( | const std::string & | datasetpath, |
| const std::string & | blockName | ||
| ) | const |
Determines whether a block of data exists in a dataset.
This method determines whether a block of data (specified with a block number) exists in a dataset.
| datasetpath | is the seismic drive dataset name ( sd://tenant/subproject/path/dataset ) |
| blockName | is the name of the block |
| std::string seismicdrive::SDUtils::bulkChangeTier | ( | const std::string & | path, |
| const std::string & | storageTier | ||
| ) | const |
Add a bulk change-tier request to the operation task queue.
This method return a operation-id that can be used to track the progress of the request.
| path | the seismic drive subProject path ( sd://tenant/subproject/path/ ) |
SDManager manager; SDutils utils(&manager);
auto response = utils.bulkChangeTier(path); std::cout<< response <<'
';
| std::string seismicdrive::SDUtils::bulkChangeTierDataset | ( | std::string & | datasetPath, |
| const std::string & | storageTier | ||
| ) | const |
Add a bulk change-tier request to the operation task queue.
This method return a operation-id that can be used to track the progress of the request.
| datasetPath | the seismic drive datasetPath path ( sd://tenant/subproject/path/dataset ) |
usage example:
SDManager manager; SDutils utils(&manager);
auto response = utils.bulkChangeTierDataset(datasetPath); std::cout<< response <<'
';
| BulkChangeTierStatus seismicdrive::SDUtils::bulkChangeTierStatus | ( | const std::string & | operationId, |
| const std::string & | dataPartitionId | ||
| ) | const |
Get the status of a bulk change-tier operation.
This method returns the status a bulk delete request.
| operationId | the seismic drive subProject path ( sd://tenant/subproject/path ) |
| dataPartitionId | the seismic drive subProject path ( sd://tenant/subproject/path ) |
usage example:
SDManager manager; SDutils utils(&manager);
auto response = utils.bulkChangeTierStatus(operationId, dataPartitionId); std::cout << response.status <<'
';
| std::string seismicdrive::SDUtils::bulkChangeTierSubProjectPath | ( | std::string & | subProjectPath, |
| const std::string & | storageTier | ||
| ) | const |
Add a bulk change-tier request to the operation task queue.
This method return a operation-id that can be used to track the progress of the request.
| subProjectPath | the seismic drive subProject path ( sd://tenant/subproject/path/ ) |
usage example:
SDManager manager; SDutils utils(&manager);
auto response = utils.bulkChangeTierSubProjectPath(subProjectPath); std::cout<< response <<'
';
| std::string seismicdrive::SDUtils::bulkDelete | ( | const std::string & | path | ) | const |
Add a bulk delete request to the operation task queue.
This method return a operation-id that can be used to track the progress of the request.
For a subProject path the string must end with a '/'. For a single dataset do not add '/' to the end
| path | the seismic drive subProject path ( sd://tenant/subproject/path/ ) |
usage example:
SDManager manager; SDutils utils(&manager);
auto response = utils.bulkDelete(path); std::cout<< response <<'
';
| std::string seismicdrive::SDUtils::bulkDeleteDataset | ( | std::string & | datasetPath | ) | const |
Add a bulk delete request to the operation task queue.
This method return a operation-id that can be used to track the progress of the request.
| datasetPath | the seismic drive datasetPath path ( sd://tenant/subproject/path/dataset ) |
usage example:
SDManager manager; SDutils utils(&manager);
auto response = utils.bulkDeleteDataset(datasetPath); std::cout<< response <<'
';
| BulkDeleteStatus seismicdrive::SDUtils::bulkDeleteStatus | ( | const std::string & | operationId, |
| const std::string & | dataPartitionId | ||
| ) | const |
Get the status of a bulk delete operation.
This method returns the status a bulk delete request.
| operationId | the seismic drive subProject path ( sd://tenant/subproject/path ) |
| dataPartitionId | the seismic drive subProject path ( sd://tenant/subproject/path ) |
usage example:
SDManager manager; SDutils utils(&manager);
auto response = utils.bulkDeleteStatus(operationId, dataPartitionId); std::cout << response.status <<'
';
| std::string seismicdrive::SDUtils::bulkDeleteSubProjectPath | ( | std::string & | subProjectPath | ) | const |
Add a bulk delete request to the operation task queue.
This method return a operation-id that can be used to track the progress of the request.
| subProjectPath | the seismic drive subProject path ( sd://tenant/subproject/path/ ) |
usage example:
SDManager manager; SDutils utils(&manager);
auto response = utils.bulkDeleteSubProjectPath(subProjectPath); std::cout<< response <<'
';
| bool seismicdrive::SDUtils::datasetExist | ( | const std::string & | fileName | ) |
Deprecated.
Use datasetExists() instead
| bool seismicdrive::SDUtils::datasetExists | ( | const std::string & | fileName | ) |
Checks for existance of a file.
This method checks if a single file exists in cloud storage. This is much slower per file than checking all file names together.
| fileName | name of file to check ( sd://tenant/subproject/path/dataset ) |
| std::vector<std::string> seismicdrive::SDUtils::datasetList | ( | const std::string & | subProjectPath, |
| std::string & | cursor, | ||
| int | limit = 100 |
||
| ) | const |
list datasets of a seismic store subProjectPath.
This method return a list datasets of a seismic store subProjectPath.
| subProjectPath | the seismic drive subProject path ( sd://tenant/subproject/ ) |
| cursor | the next page cursor (empty will return the first page) |
| limit | the results max page size (100 default) |
usage example:
SDManager manager; SDutils utils(&manager); std::string nextPageToken; do { auto response = utils.datasetList(path, nextPageToken, 100); for(auto &item: response.first) { std::cout<<item<<'
'; } } while(!nextPageToken.empty())
| std::vector<bool> seismicdrive::SDUtils::datasetsExist | ( | const std::vector< std::string > & | sdfileNames | ) |
Checks for existance of several files.
This method checks if a list of filenames exists in cloud storage. This is much faster than checking each file name separately
| sdfileNames | list of dataset path ( sd://tenant/subproject/path/dataset ). All sdfileNames must refer to the same subproject (must have the same sd://tenant/subproject prefix) |
| int64_t seismicdrive::SDUtils::datasetSize | ( | const std::string & | fileName | ) |
Get the file size in bytes.
This method gets the size in bytes of one single dataset. This method returns -1 if file does not exist or is empty.
| fileName | name of file to get size ( sd://tenant/subproject/path/dataset ) |
| std::vector<int64_t> seismicdrive::SDUtils::datasetSizes | ( | const std::vector< std::string > & | sdfileNames | ) |
Get the file size in bytes of several files.
This method gets the size of a list of datasets in bytes. The method returns -1 for files that do not exist.
| sdfileNames | list of dataset path ( sd://tenant/subproject/path/dataset ) All sdfileNames must refer to the same subproject (must have the same sd://tenant/subproject prefix) |
| std::vector<int64_t> seismicdrive::SDUtils::datasetsSize | ( | const std::vector< std::string > & | sdfileNames | ) |
Deprecated.
Use datasetSizes() instead
| void seismicdrive::SDUtils::datasetUnlock | ( | const std::string & | seistoreDatasetPath | ) | const |
| void seismicdrive::SDUtils::deleteDataset | ( | const std::string & | sddatasetname | ) |
Delete a dataset (objects removed via service)
This method is used to delete a dataset given its full path name. The objects deletion process will delegate to SDMS service.
| sddatasetname | is the seismic drive dataset name ( sd://tenant/subproject/path/dataset ) |
| error::dataset::Locked | occurs in certain circumstances ( 502 timeout by proxy, for example ) since these are not automatically retried by the library and the caller needs to decide whether it's appropriate to wait and retry |
| void seismicdrive::SDUtils::deleteDatasetSync | ( | const std::string & | datasetUri | ) |
Delete a dataset (objects removed via sdk)
This method is used to delete a dataset given its full path name. The objects deletion process will directly performed by the sdapi sdk.
| datasetUri | is the seismic dms dataset uri path ( sd://tenant/subproject/path/dataset ) |
| std::string seismicdrive::SDUtils::getCreatedBy | ( | const std::string & | seistoreDatasetPath | ) | const |
Get dataset "create by".
This method can be used to retrieve the "created by" field associated with a dataset.
usage example:
| seistoreDatasetPath | is the seismic-store dataset path |
| std::string seismicdrive::SDUtils::getCreatedDate | ( | const std::string & | seistoreDatasetPath | ) | const |
Get dataset created date.
This method can be used to retrieve the dataset creation date.
usage example:
| seistoreDatasetPath | is the seismic-store dataset path |
| std::string seismicdrive::SDUtils::getFileMetaData | ( | const std::string & | seistoreDatasetPath | ) | const |
Gets the user-defined filemetadata of the current dataset.
This method is an accessor used to get the user-defined filemetadata from the current dataset
usage example:
| std::string seismicdrive::SDUtils::getLastModifiedDate | ( | const std::string & | seistoreDatasetPath | ) | const |
Get dataset last modified date.
This method can be used to retrieve the dataset last modified date.
usage example:
| seistoreDatasetPath | is the seismic-store dataset path |
| std::string seismicdrive::SDUtils::getLegalTag | ( | const std::string & | seistoreDatasetPath | ) | const |
Get dataset legal-tag.
This method can be used to retrieve the dataset type associated with a dataset.
usage example:
| seistoreDatasetPath | is the seismic-store dataset path |
| std::string seismicdrive::SDUtils::getOpenSessionID | ( | const std::string & | seistoreDatasetPath | ) | const |
Get the dataset open session id.
This method can be used to get the dataset open session id.
usage example:
| seistoreDatasetPath | is the seismic-store dataset path |
| std::string seismicdrive::SDUtils::getServiceCloudProivider | ( | ) | const |
Returns the current cloud provider.
| std::string seismicdrive::SDUtils::getType | ( | const std::string & | seistoreDatasetPath | ) | const |
Get dataset type.
This method can be used to retrieve the dataset type associated with a dataset.
usage example:
| seistoreDatasetPath | is the seismic-store dataset path |
|
static |
Check if a dataset path is a valid seismic-store dataset path.
This method checks if a given sd path exits in cloud storage.
| datasetpath | is the seismic-store dataset path to validate |
| std::pair<std::vector<std::string>, std::vector<std::string> > seismicdrive::SDUtils::ls | ( | const std::string & | path, |
| std::string & | cursor, | ||
| int | limit = 10000 |
||
| ) | const |
list datasets and directories content of a seismic store path.
This method return a list of files and folders of a seismic store path.
| path | the seismic drive directory path ( sd://tenant/subproject/path ) |
| cursor | the next page cursor (empty will return the first page) |
| limit | the results max page size (10000 default) |
usage example:
SDManager manager; SDutils utils(&manager); std::string nextPageToken; do { auto response = utils.ls("sd://tenant/subproject/path", nextPageToken); for(auto &item: response.first) { std::cout<<item<<'
'; } for(auto &item: response.second) { std::cout<<item<<'
'; } } while(!cursor.empty())
Move Assignment Operator.
Same functionality as the move constructor.
Copy Assignment Operator.
Same functionality as the copy constructor.
| std::vector<std::vector<std::string> > seismicdrive::SDUtils::readDirectory | ( | const std::string & | sddirectorypath | ) | const |
List Datasets and directories in a directory.
This method return a list of files and folders in a given full path directory.
| sddirectorypath | is the seismic drive directory path ( sd://tenant/subproject/path ) |
| bool seismicdrive::SDUtils::updateStorageTier | ( | const std::string & | sdpath, |
| const std::string & | storageTier | ||
| ) | const |
| void seismicdrive::SDUtils::upload | ( | const std::string & | datasetpath, |
| const std::string & | filename | ||
| ) | const |
|
friend |
1.8.14