{"_id":"5c2243ba20a3f9010e7f5973","project":"55faf11ba62ba1170021a9a7","version":{"_id":"55faf11ba62ba1170021a9aa","project":"55faf11ba62ba1170021a9a7","__v":44,"createdAt":"2015-09-17T16:58:03.490Z","releaseDate":"2015-09-17T16:58:03.490Z","categories":["55faf11ca62ba1170021a9ab","55faf8f4d0e22017005b8272","55faf91aa62ba1170021a9b5","55faf929a8a7770d00c2c0bd","55faf932a8a7770d00c2c0bf","55faf94b17b9d00d00969f47","55faf958d0e22017005b8274","55faf95fa8a7770d00c2c0c0","55faf96917b9d00d00969f48","55faf970a8a7770d00c2c0c1","55faf98c825d5f19001fa3a6","55faf99aa62ba1170021a9b8","55faf99fa62ba1170021a9b9","55faf9aa17b9d00d00969f49","55faf9b6a8a7770d00c2c0c3","55faf9bda62ba1170021a9ba","5604570090ee490d00440551","5637e8b2fbe1c50d008cb078","5649bb624fa1460d00780add","5671974d1b6b730d008b4823","5671979d60c8e70d006c9760","568e8eef70ca1f0d0035808e","56d0a2081ecc471500f1795e","56d4a0adde40c70b00823ea3","56d96b03dd90610b00270849","56fbb83d8f21c817002af880","573c811bee2b3b2200422be1","576bc92afb62dd20001cda85","5771811e27a5c20e00030dcd","5785191af3a10c0e009b75b0","57bdf84d5d48411900cd8dc0","57ff5c5dc135231700aed806","5804caf792398f0f00e77521","58458b4fba4f1c0f009692bb","586d3c287c6b5b2300c05055","58ef66d88646742f009a0216","58f5d52d7891630f00fe4e77","59a555bccdbd85001bfb1442","5a2a81f688574d001e9934f5","5b080c8d7833b20003ddbb6f","5c222bed4bc358002f21459a","5c22412594a2a5005cc9e919","5c41ae1c33592700190a291e","5c8a525e2ba7b2003f9b153c"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"5c22412594a2a5005cc9e919","project":"55faf11ba62ba1170021a9a7","version":"55faf11ba62ba1170021a9aa","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2018-12-25T14:39:33.459Z","from_sync":false,"order":31,"slug":"sb-cli","title":"SB Command Line Interface"},"user":"566590c83889610d0008a253","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-12-25T14:50:34.561Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"##Overview\n\nUse the following commands to manage files and metadata on the CGC.\n\n<div align=\"right\"><a href=\"#top\">top</a></div>\n\n##files list\n\nGet a list of files in the specified project with specified properties that you can access. Note that the ID of a file is not the same as its filename. The ID is a hexadecimal string automatically assigned to a file in a project.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Usage:\\n  sb files list [--project <project_value>] [--public] [--filenames <filenames_value> ...] [--metadata <metadata_value> ...] [--origin <origin_value>] [--tags <tags_value> ...]\\n  [flags]\\n\\nFlags:\\n      --project string          Retrieve the files belonging to the specified project.\\n      --public                  Retrieve publicly available files.\\n      --filenames stringSlice   List files with names that match the exact complete string.\\n      --metadata stringSlice    List only files  that have the specified value in the given metadata key.\\n      --origin string           List only files produced by the given task (provide task ID).\\n      --tags stringSlice        List only files tagged with this exact complete string.\\n  -h, --help                    help for list\",\n      \"language\": \"text\",\n      \"name\": \"files list\"\n    }\n  ]\n}\n[/block]\n<div align=\"right\"><a href=\"#top\">top</a></div>\n\n##files get\n\nGet details of the specified file. Note that the ID of a file is not the same as its filename. You can obtain the file_id by listing all files in a specified project.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Usage:\\n  sb files get <file_id> [flags]\\n\\nArguments:\\n      file_id   ID of the file.\\n\\nFlags:\\n  -h, --help   help for get\",\n      \"language\": \"text\",\n      \"name\": \"files get\"\n    }\n  ]\n}\n[/block]\n<div align=\"right\"><a href=\"#top\">top</a></div>\n\n##files copy\n\nCopy the specified file to a new project. Files retain their metadata when copied but may be assigned new names in their target project.\n\nNote that the ID of a file is not the same as its filename. You can obtain the file_id by listing all files in a specified project.\n\nTo make this call, you should have copy permission within the project from which you are copying the file.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Usage:\\n  sb files copy <file_id> --project <project_value> [--name <name_value>] [flags]\\n\\nArguments:\\n      file_id   ID of the file.\\n\\nFlags:\\n      --project string   The name of the project to which you want to copy the file.\\n      --name string      An optional new name for the file.\\n  -h, --help             help for copy\",\n      \"language\": \"text\",\n      \"name\": \"files copy\"\n    }\n  ]\n}\n[/block]\n<div align=\"right\"><a href=\"#top\">top</a></div>\n\n##files update\n\nUpdate the name, the full set of metadata, and/or tags for the specified file.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Usage:\\n  sb files update <file_id> [--name <name_value>] [--metadata <metadata_value> ...] [--tag <tag_value> ...] [flags]\\n\\nArguments:\\n      file_id   ID of the file.\\n\\nFlags:\\n      --name string            The new name for the file.\\n      --metadata stringSlice   The metadata key(s) and their values that you want to update.\\n      --tag stringSlice        The tag(s) that you want to update.\\n  -h, --help                   help for update\",\n      \"language\": \"text\",\n      \"name\": \"files update\"\n    }\n  ]\n}\n[/block]\n<div align=\"right\"><a href=\"#top\">top</a></div>\n\n##files url\n\nGet a URL that you can use to download the specified file.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Usage:\\n  sb files url <file_id> [flags]\\n\\nArguments:\\n      file_id   ID of the file.\\n\\nFlags:\\n  -h, --help   help for url\",\n      \"language\": \"text\",\n      \"name\": \"files url\"\n    }\n  ]\n}\n[/block]\n<div align=\"right\"><a href=\"#top\">top</a></div>\n\n##files delete\n\nDelete the specified file.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Usage:\\n  sb files delete <file_id> [flags]\\n\\nArguments:\\n      file_id   ID of the file.\\n\\nFlags:\\n  -h, --help   help for delete\",\n      \"language\": \"text\",\n      \"name\": \"files delete\"\n    }\n  ]\n}\n[/block]\n<div align=\"right\"><a href=\"#top\">top</a></div>\n\n##files metadata get\n\nReturns the metadata values for the specified file.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Usage:\\n  sb files metadata get <file_id> [flags]\\n\\nArguments:\\n      file_id   ID of the file.\\n\\nFlags:\\n  -h, --help   help for get\",\n      \"language\": \"text\",\n      \"name\": \"files metadata get\"\n    }\n  ]\n}\n[/block]\n<div align=\"right\"><a href=\"#top\">top</a></div>\n\n##files metadata edit\n\nModifies the metadata for the specified file.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Usage:\\n  sb files metadata edit <file_id> --metadata <metadata_value> ... [flags]\\n\\nArguments:\\n      file_id   ID of the file.\\n\\nFlags:\\n      --metadata stringSlice   The metadata keys and their values that you want to modify.\\n  -h, --help                   help for edit\",\n      \"language\": \"text\",\n      \"name\": \"files metadata edit\"\n    }\n  ]\n}\n[/block]\n<div align=\"right\"><a href=\"#top\">top</a></div>\n\n##files metadata overwrite\n\nOverwrites the metadata for the specified file. Note that unlike the edit command, this command fully overwrites the values for all metadata fields. This means that when you run this command, you must enter values for every key required to specify the metadata, even if the values for some keys are unchanged. If you don't specify a value for a given metadata field, then any existing value for that field will be removed.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Usage:\\n  sb files metadata overwrite <file_id> --metadata <metadata_value> ... [flags]\\n\\nArguments:\\n      file_id   ID of the file.\\n\\nFlags:\\n      --metadata stringSlice   The metadata key(s) and their values that you want to modify.\\n  -h, --help                  help for overwrite\",\n      \"language\": \"text\",\n      \"name\": \"files metadata overwrite\"\n    }\n  ]\n}\n[/block]\n<div align=\"right\"><a href=\"#top\">top</a></div>","excerpt":"","slug":"files-and-metadata","type":"basic","title":"Files and metadata"}

Files and metadata


##Overview Use the following commands to manage files and metadata on the CGC. <div align="right"><a href="#top">top</a></div> ##files list Get a list of files in the specified project with specified properties that you can access. Note that the ID of a file is not the same as its filename. The ID is a hexadecimal string automatically assigned to a file in a project. [block:code] { "codes": [ { "code": "Usage:\n sb files list [--project <project_value>] [--public] [--filenames <filenames_value> ...] [--metadata <metadata_value> ...] [--origin <origin_value>] [--tags <tags_value> ...]\n [flags]\n\nFlags:\n --project string Retrieve the files belonging to the specified project.\n --public Retrieve publicly available files.\n --filenames stringSlice List files with names that match the exact complete string.\n --metadata stringSlice List only files that have the specified value in the given metadata key.\n --origin string List only files produced by the given task (provide task ID).\n --tags stringSlice List only files tagged with this exact complete string.\n -h, --help help for list", "language": "text", "name": "files list" } ] } [/block] <div align="right"><a href="#top">top</a></div> ##files get Get details of the specified file. Note that the ID of a file is not the same as its filename. You can obtain the file_id by listing all files in a specified project. [block:code] { "codes": [ { "code": "Usage:\n sb files get <file_id> [flags]\n\nArguments:\n file_id ID of the file.\n\nFlags:\n -h, --help help for get", "language": "text", "name": "files get" } ] } [/block] <div align="right"><a href="#top">top</a></div> ##files copy Copy the specified file to a new project. Files retain their metadata when copied but may be assigned new names in their target project. Note that the ID of a file is not the same as its filename. You can obtain the file_id by listing all files in a specified project. To make this call, you should have copy permission within the project from which you are copying the file. [block:code] { "codes": [ { "code": "Usage:\n sb files copy <file_id> --project <project_value> [--name <name_value>] [flags]\n\nArguments:\n file_id ID of the file.\n\nFlags:\n --project string The name of the project to which you want to copy the file.\n --name string An optional new name for the file.\n -h, --help help for copy", "language": "text", "name": "files copy" } ] } [/block] <div align="right"><a href="#top">top</a></div> ##files update Update the name, the full set of metadata, and/or tags for the specified file. [block:code] { "codes": [ { "code": "Usage:\n sb files update <file_id> [--name <name_value>] [--metadata <metadata_value> ...] [--tag <tag_value> ...] [flags]\n\nArguments:\n file_id ID of the file.\n\nFlags:\n --name string The new name for the file.\n --metadata stringSlice The metadata key(s) and their values that you want to update.\n --tag stringSlice The tag(s) that you want to update.\n -h, --help help for update", "language": "text", "name": "files update" } ] } [/block] <div align="right"><a href="#top">top</a></div> ##files url Get a URL that you can use to download the specified file. [block:code] { "codes": [ { "code": "Usage:\n sb files url <file_id> [flags]\n\nArguments:\n file_id ID of the file.\n\nFlags:\n -h, --help help for url", "language": "text", "name": "files url" } ] } [/block] <div align="right"><a href="#top">top</a></div> ##files delete Delete the specified file. [block:code] { "codes": [ { "code": "Usage:\n sb files delete <file_id> [flags]\n\nArguments:\n file_id ID of the file.\n\nFlags:\n -h, --help help for delete", "language": "text", "name": "files delete" } ] } [/block] <div align="right"><a href="#top">top</a></div> ##files metadata get Returns the metadata values for the specified file. [block:code] { "codes": [ { "code": "Usage:\n sb files metadata get <file_id> [flags]\n\nArguments:\n file_id ID of the file.\n\nFlags:\n -h, --help help for get", "language": "text", "name": "files metadata get" } ] } [/block] <div align="right"><a href="#top">top</a></div> ##files metadata edit Modifies the metadata for the specified file. [block:code] { "codes": [ { "code": "Usage:\n sb files metadata edit <file_id> --metadata <metadata_value> ... [flags]\n\nArguments:\n file_id ID of the file.\n\nFlags:\n --metadata stringSlice The metadata keys and their values that you want to modify.\n -h, --help help for edit", "language": "text", "name": "files metadata edit" } ] } [/block] <div align="right"><a href="#top">top</a></div> ##files metadata overwrite Overwrites the metadata for the specified file. Note that unlike the edit command, this command fully overwrites the values for all metadata fields. This means that when you run this command, you must enter values for every key required to specify the metadata, even if the values for some keys are unchanged. If you don't specify a value for a given metadata field, then any existing value for that field will be removed. [block:code] { "codes": [ { "code": "Usage:\n sb files metadata overwrite <file_id> --metadata <metadata_value> ... [flags]\n\nArguments:\n file_id ID of the file.\n\nFlags:\n --metadata stringSlice The metadata key(s) and their values that you want to modify.\n -h, --help help for overwrite", "language": "text", "name": "files metadata overwrite" } ] } [/block] <div align="right"><a href="#top">top</a></div>