|
| 1 | +--- |
| 2 | +title: "cmemc: Command Group - project file" |
| 3 | +description: "List, inspect, up-/download or delete project file resources." |
| 4 | +icon: eccenca/artefact-file |
| 5 | +tags: |
| 6 | + - Files |
| 7 | + - cmemc |
| 8 | +--- |
| 9 | +# project file Command Group |
| 10 | +<!-- This file was generated - DO NOT CHANGE IT MANUALLY --> |
| 11 | + |
| 12 | +List, inspect, up-/download or delete project file resources. |
| 13 | + |
| 14 | +File resources are identified with a `RESOURCE_ID` which is a concatenation of its project ID and its relative path, e.g. `my-project:path-to/table.csv`. |
| 15 | + |
| 16 | +!!! note |
| 17 | + To get a list of existing file resources, execute the `project file list` command or use tab-completion. |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +## project file list |
| 22 | + |
| 23 | +List available file resources. |
| 24 | + |
| 25 | +```shell-session title="Usage" |
| 26 | +$ cmemc project file list [OPTIONS] |
| 27 | +``` |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +Outputs a table or a list of file resources. |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | +??? info "Options" |
| 37 | + ```text |
| 38 | + |
| 39 | + --raw Outputs raw JSON. |
| 40 | + --id-only Lists only resource IDs and no other metadata. This |
| 41 | + is useful for piping the IDs into other commands. |
| 42 | + --filter <TEXT TEXT>... Filter file resources based on metadata. First |
| 43 | + parameter CHOICE can be one of ['project', |
| 44 | + 'regex']. The second parameter is based on CHOICE, |
| 45 | + e.g. a project ID or a regular expression string. |
| 46 | + ``` |
| 47 | + |
| 48 | +## project file delete |
| 49 | + |
| 50 | +Delete file resources. |
| 51 | + |
| 52 | +```shell-session title="Usage" |
| 53 | +$ cmemc project file delete [OPTIONS] [RESOURCE_IDS]... |
| 54 | +``` |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | +There are three selection mechanisms: with specific IDs - only those specified resources will be deleted; by using `--filter` - resources based on the filter type and value will be deleted; by using `--all`, which will delete all resources. |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | +??? info "Options" |
| 64 | + ```text |
| 65 | + |
| 66 | + --force Delete resource even if in use by a task. |
| 67 | + -a, --all Delete all resources. This is a dangerous option, |
| 68 | + so use it with care. |
| 69 | + --filter <TEXT TEXT>... Filter file resources based on metadata. First |
| 70 | + parameter CHOICE can be one of ['project', |
| 71 | + 'regex']. The second parameter is based on CHOICE, |
| 72 | + e.g. a project ID or a regular expression string. |
| 73 | + ``` |
| 74 | + |
| 75 | +## project file download |
| 76 | + |
| 77 | +Download file resources to the local file system. |
| 78 | + |
| 79 | +```shell-session title="Usage" |
| 80 | +$ cmemc project file download [OPTIONS] [RESOURCE_IDS]... |
| 81 | +``` |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | +This command downloads one or more file resources from projects to your local file system. Files are saved with their resource names in the output directory. |
| 87 | + |
| 88 | +Resources are identified by their IDs in the format `PROJECT_ID`:`RESOURCE_NAME`. |
| 89 | + |
| 90 | +```shell-session title="Example" |
| 91 | +$ cmemc project file download my-proj:my-file.csv |
| 92 | +``` |
| 93 | + |
| 94 | + |
| 95 | +```shell-session title="Example" |
| 96 | +$ cmemc project file download my-proj:file1.csv my-proj:file2.csv --output-dir /tmp |
| 97 | +``` |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | +??? info "Options" |
| 103 | + ```text |
| 104 | + |
| 105 | + --output-dir DIRECTORY The directory where the downloaded files will be |
| 106 | + saved. If this directory does not exist, it will be |
| 107 | + created. [default: .] |
| 108 | + --replace Replace existing files. This is a dangerous option, |
| 109 | + so use it with care! |
| 110 | + ``` |
| 111 | + |
| 112 | +## project file upload |
| 113 | + |
| 114 | +Upload a file to a project. |
| 115 | + |
| 116 | +```shell-session title="Usage" |
| 117 | +$ cmemc project file upload [OPTIONS] INPUT_PATH |
| 118 | +``` |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | +This command uploads a file to a project as a file resource. |
| 124 | + |
| 125 | +!!! note |
| 126 | + If you want to create a dataset from your file, the `dataset create` command is maybe the better option. |
| 127 | + |
| 128 | + |
| 129 | +```shell-session title="Example" |
| 130 | +$ cmemc project file upload my-file.csv --project my-project |
| 131 | +``` |
| 132 | + |
| 133 | + |
| 134 | + |
| 135 | + |
| 136 | +??? info "Options" |
| 137 | + ```text |
| 138 | + |
| 139 | + --project TEXT The project where you want to upload the file. If there is |
| 140 | + only one project in the workspace, this option can be |
| 141 | + omitted. |
| 142 | + --path TEXT The path/name of the file resource in the project (e.g., |
| 143 | + 'data/file.csv'). If not specified, the local file name will |
| 144 | + be used. |
| 145 | + --replace Replace existing file resource. This is a dangerous option, |
| 146 | + so use it with care! |
| 147 | + ``` |
| 148 | + |
| 149 | +## project file inspect |
| 150 | + |
| 151 | +Display all metadata of a file resource. |
| 152 | + |
| 153 | +```shell-session title="Usage" |
| 154 | +$ cmemc project file inspect [OPTIONS] RESOURCE_ID |
| 155 | +``` |
| 156 | + |
| 157 | + |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | +??? info "Options" |
| 162 | + ```text |
| 163 | + |
| 164 | + --raw Outputs raw JSON. |
| 165 | + ``` |
| 166 | + |
| 167 | +## project file usage |
| 168 | + |
| 169 | +Display all usage data of a file resource. |
| 170 | + |
| 171 | +```shell-session title="Usage" |
| 172 | +$ cmemc project file usage [OPTIONS] RESOURCE_ID |
| 173 | +``` |
| 174 | + |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | + |
| 179 | +??? info "Options" |
| 180 | + ```text |
| 181 | + |
| 182 | + --raw Outputs raw JSON. |
| 183 | + ``` |
| 184 | + |
0 commit comments