Admin
Bases: Consolidater
Source code in geocube/admin.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
__init__(uri, secure=False, api_key='', verbose=True)
Initialise the connexion to the Geocube Server
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uri |
str
|
of the Geocube Server |
required |
secure |
bool
|
True to use a TLS Connexion |
False
|
api_key |
str
|
(optional) API Key if Geocube Server is secured using a bearer authentication |
''
|
verbose |
bool
|
display the version of the Geocube Server |
True
|
Source code in geocube/admin.py
9 10 11 12 13 14 15 16 17 18 19 20 |
|
admin_delete_datasets(instances, records, file_patterns=None, execution_level=entities.ExecutionLevel.STEP_BY_STEP_CRITICAL, job_name=None)
Admin function to delete datasets that are referenced by a list of instances and a list of records. This function is provided without any guaranties of service continuity. In the future, a secured function will be provided to safely delete datasets.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instances |
List[Union[str, entities.VariableInstance]]
|
select all the datasets referenced by these instances. |
required |
records |
List[Union[str, entities.Record]]
|
select all the datasets referenced by these records. |
required |
file_patterns |
List[str]
|
select all the datasets with on of the given file patterns (support * and ? for all or any characters and trailing (?i) for case-insensitiveness) |
None
|
execution_level |
entities.ExecutionLevel
|
see entities.ExecutionLevel. |
entities.ExecutionLevel.STEP_BY_STEP_CRITICAL
|
job_name |
str
|
[optional] gives a name to the job, otherwise, a name will be automatically generated |
None
|
Source code in geocube/admin.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
admin_tidy(aois=False, records=False, variables=False, instances=False, containers=False, consolidation_params=False, simulate=True)
Admin function to tidy the Geocube Database. Remove all the entities that are not linked to any dataset. Should be used with caution when no ingestion or indexation task is in progress.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
aois |
bool
|
remove the pending AOI |
False
|
records |
bool
|
remove the pending Records |
False
|
variables |
bool
|
remove the pending Variables |
False
|
instances |
bool
|
remove the pending Instances |
False
|
containers |
bool
|
remove the pending Containers |
False
|
consolidation_params |
bool
|
remove the pending ConsolidationParams |
False
|
simulate |
bool
|
if True no operation is performed. Only the number of entities that would have been deleted |
True
|
Source code in geocube/admin.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
admin_update_datasets(instance, records, dformat, min_out, max_out, exponent, simulate)
Admin function to update some sensitive information of datasets referenced by an instance and a list of records
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instance |
Union[str, entities.VariableInstance]
|
select the datasets that are referenced by this instance |
required |
records |
List[Union[str, entities.Record]]
|
select the datasets that are referenced by these records |
required |
dformat |
Union[Dict, Tuple, str]
|
new dataformat |
required |
min_out |
float
|
new min_out |
required |
max_out |
float
|
new max_out |
required |
exponent |
float
|
new exponent |
required |
simulate |
bool
|
if True, no operation is performed. Only display the datasets that would have been updated. |
required |
Source code in geocube/admin.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|