Description

Get information about directory objects. Directories are identified by sha1 checksums, compatible with Git directory identifiers. See swh.model.git_objects.directory_git_object in our data model module for details about how they are computed.

When given only a directory identifier, this endpoint returns information about the directory itself, returning its content (usually a list of directory entries). When given a directory identifier and a path, this endpoint returns information about the directory entry pointed by the relative path, starting path resolution from the given directory.

Request

GET https://archive.softwareheritage.org/api/1/directory/6d8ce40edd85daec3653450f3b9220c135acdaca/

Response

Body
[
    {
        "checksums": {
            "sha1": "05397022fdf7ab84c4647df8e597b8175476617f",
            "sha1_git": "fb62b5b56a2b5ba1c8a755288766a638bea63634",
            "sha256": "ceecef97a7172424b0cb5f5a72537e0e0abde8d39f545e9588a54199ec7fc76c"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 25575,
        "name": "ACKS",
        "perms": 33188,
        "status": "visible",
        "target": "fb62b5b56a2b5ba1c8a755288766a638bea63634",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:fb62b5b56a2b5ba1c8a755288766a638bea63634/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "2d4488744fd57f00e39c0b57be8801c5b96e7d3f",
            "sha1_git": "4ce431f660e1cc8249a85e7ef2c05272775d6be3",
            "sha256": "ed1034d0d50dcbd8decdb4b0adbb72f67fe0613029e66ac16299a882d2cb030c"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 1355245,
        "name": "HISTORY",
        "perms": 33188,
        "status": "visible",
        "target": "4ce431f660e1cc8249a85e7ef2c05272775d6be3",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:4ce431f660e1cc8249a85e7ef2c05272775d6be3/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "2f589214e1d425fe0ada07ddea1181d201d34be7",
            "sha1_git": "f2c1994ccf6939ede1734cac01b451840527607d",
            "sha256": "09e5f47bd29e7ad8119adee346dd633ac7e6e6690093076423e08a636de8c5e4"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 364377,
        "name": "NEWS",
        "perms": 33188,
        "status": "visible",
        "target": "f2c1994ccf6939ede1734cac01b451840527607d",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:f2c1994ccf6939ede1734cac01b451840527607d/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "716a5f8b8ff6ac01507d0e4c04771ec387ca87ee",
            "sha1_git": "c43b112978845494e078a57f9d76f69a09caa2d0",
            "sha256": "2d7f8a210657ae4afe41cbe6543363c5fa6c06cc6bd9e3fbd4adb6a6971c04ea"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 107,
        "name": "Porting",
        "perms": 33188,
        "status": "visible",
        "target": "c43b112978845494e078a57f9d76f69a09caa2d0",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:c43b112978845494e078a57f9d76f69a09caa2d0/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "756c69d54c9a481a9f1c6b39406cb8b50647b7b6",
            "sha1_git": "ddb8f3f975904a4c181c09852923b0b219609ee9",
            "sha256": "6ee1cc2e08d6f0ccc0714aea55b412593635a4c82e2688034be4b2eadbc8e33f"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 1424,
        "name": "README",
        "perms": 33188,
        "status": "visible",
        "target": "ddb8f3f975904a4c181c09852923b0b219609ee9",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:ddb8f3f975904a4c181c09852923b0b219609ee9/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "915f01e41df22502472ede9a1c5dd15aedfe8d81",
            "sha1_git": "b3e64724d76dbab615ad6d19834e968e17ff607c",
            "sha256": "b2f7040ff21f227343133ca786ffad19c1515fb4f1c39b858525e5a31cbe9575"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 5073,
        "name": "README.AIX",
        "perms": 33188,
        "status": "visible",
        "target": "b3e64724d76dbab615ad6d19834e968e17ff607c",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:b3e64724d76dbab615ad6d19834e968e17ff607c/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "1bae6fd245afd9a8f0c9c638ad748ef6300e282a",
            "sha1_git": "f5e1bf6f28d245bd3fe0c5da59c9ef0ab9e2d5b2",
            "sha256": "9e03c96a6816979d7643add104aaf2e333990622483c4c38845c1e1e61240056"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 845,
        "name": "README.coverity",
        "perms": 33188,
        "status": "visible",
        "target": "f5e1bf6f28d245bd3fe0c5da59c9ef0ab9e2d5b2",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:f5e1bf6f28d245bd3fe0c5da59c9ef0ab9e2d5b2/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "f958edaa0ce5e44d0241bbea886f4e83fc6cf639",
            "sha1_git": "908f137eff0707e947969966acf984b2d772dffd",
            "sha256": "ffd112649b2ec6b0b90451b5ae86322bbaffdbba6a54acb637a49d73e15b898d"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 4557,
        "name": "README.valgrind",
        "perms": 33188,
        "status": "visible",
        "target": "908f137eff0707e947969966acf984b2d772dffd",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:908f137eff0707e947969966acf984b2d772dffd/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "86ca9d753a00f22b65a77b1325e70b91f077186a",
            "sha1_git": "6799ea3ff16c5d7104b0c39a106d8a89fc93a405",
            "sha256": "ba53fef0c6d3b2b47f776041b09f963b9386c6ae0f0b32db1674017758c573d0"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 9927,
        "name": "SpecialBuilds.txt",
        "perms": 33188,
        "status": "visible",
        "target": "6799ea3ff16c5d7104b0c39a106d8a89fc93a405",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:6799ea3ff16c5d7104b0c39a106d8a89fc93a405/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "9002def840578408a689f3cbaa9d6192b8675ca9",
            "sha1_git": "1ae617911ce653226890dd94f698969a2c2a777c",
            "sha256": "871ad4562764fea7c62a09e90b4717f1e3c16e2afbf22827898eff6f10409544"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 4193,
        "name": "coverity_model.c",
        "perms": 33188,
        "status": "visible",
        "target": "1ae617911ce653226890dd94f698969a2c2a777c",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:1ae617911ce653226890dd94f698969a2c2a777c/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "5d6cfaeb25815859bd93b87b6bfeb7b58b995707",
            "sha1_git": "3b6fe50ef931792652c4206d0bd6cdcfe24df03f",
            "sha256": "20a7ba9e2380339d66332574c306b356a8a9b914d28830058d4a26b02cf8554c"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 4785,
        "name": "gdbinit",
        "perms": 33188,
        "status": "visible",
        "target": "3b6fe50ef931792652c4206d0bd6cdcfe24df03f",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:3b6fe50ef931792652c4206d0bd6cdcfe24df03f/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "92743380c3ed217f0b7fe88aacf59e0b6ff08390",
            "sha1_git": "02cceb62021453a0220f3a3c7b32f8d8bd4a8ea6",
            "sha256": "e0812dac74d45c6290f97c7d6a0415bc73f2c8c016dc9b872ff9a65c27916cf8"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 557,
        "name": "indent.pro",
        "perms": 33188,
        "status": "visible",
        "target": "02cceb62021453a0220f3a3c7b32f8d8bd4a8ea6",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:02cceb62021453a0220f3a3c7b32f8d8bd4a8ea6/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "016d06000a3db5f544d6fa508d6f6d42bdb9f20f",
            "sha1_git": "e13da7543c9ffb9c8fba9c60610e3e365e5c480a",
            "sha256": "543f067633c754314e41b6590876b310fc14120d6b6bedd4ffecdf965bc4ec37"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 2026,
        "name": "python-config.in",
        "perms": 33188,
        "status": "visible",
        "target": "e13da7543c9ffb9c8fba9c60610e3e365e5c480a",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:e13da7543c9ffb9c8fba9c60610e3e365e5c480a/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "d0d145f5ef5637a67325f6b3aae4572be1579900",
            "sha1_git": "30c6927871001dafc368e31e8c70717b5d9a979b",
            "sha256": "d97c66a725a8adb2c55290d46e0e15afdc3fda8b75d08656ed39f42c9e3e3507"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 2946,
        "name": "python-config.sh.in",
        "perms": 33188,
        "status": "visible",
        "target": "30c6927871001dafc368e31e8c70717b5d9a979b",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:30c6927871001dafc368e31e8c70717b5d9a979b/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "f099626ae39f9f112b87f491a8f65019c6791047",
            "sha1_git": "abe789412d9caade893d91bd70f7778f638fdab1",
            "sha256": "e1fc6e043509f379b3405f36d2ea1f6ed3b90aff3161fded688f0f87c2a8b95f"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 555,
        "name": "python-wing3.wpr",
        "perms": 33188,
        "status": "visible",
        "target": "abe789412d9caade893d91bd70f7778f638fdab1",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:abe789412d9caade893d91bd70f7778f638fdab1/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "ff8dfafd1aee7a54db45d74da07d4f37f66e2ed8",
            "sha1_git": "7adfdbdacf730e4fd0f2cd17910f9bee0dbb9379",
            "sha256": "47db348ef82ea1481286c12ad68a788305aed2d95e17183a7640526eca45a9d3"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 835,
        "name": "python-wing4.wpr",
        "perms": 33188,
        "status": "visible",
        "target": "7adfdbdacf730e4fd0f2cd17910f9bee0dbb9379",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:7adfdbdacf730e4fd0f2cd17910f9bee0dbb9379/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "181ab07c13c2f5ac596f2062a679b4b00eef0b7d",
            "sha1_git": "0e1ae635438c8a440b1b07fd4b4512ad0e833c1c",
            "sha256": "9042918a36fa26b1122c0254b1acdf0999c29efa41b701c3a6becd6cb4c0c896"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 835,
        "name": "python-wing5.wpr",
        "perms": 33188,
        "status": "visible",
        "target": "0e1ae635438c8a440b1b07fd4b4512ad0e833c1c",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:0e1ae635438c8a440b1b07fd4b4512ad0e833c1c/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "d1b9b4b1fded51e35bac6520ddc7876d6e87a2e7",
            "sha1_git": "385b6546c8a52be13df5f7c17a144f8d154d0448",
            "sha256": "ce4a5d4fd2dc85abd74333b261ed8f314c0bb2f08c849abada0183968193717b"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 13479,
        "name": "python.man",
        "perms": 33188,
        "status": "visible",
        "target": "385b6546c8a52be13df5f7c17a144f8d154d0448",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:385b6546c8a52be13df5f7c17a144f8d154d0448/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "1ea261003d41506888f5244eb85f996af083023a",
            "sha1_git": "ae698674bbc8adaa27e1167b442bb78af21df064",
            "sha256": "7f9b923ce8865b8136978cb0257b9087f116d1ec236478f6c165e177bfc08efc"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 293,
        "name": "python.pc.in",
        "perms": 33188,
        "status": "visible",
        "target": "ae698674bbc8adaa27e1167b442bb78af21df064",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:ae698674bbc8adaa27e1167b442bb78af21df064/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "edd49aa6ee3134b2e0065a6f36d7caac3df168ce",
            "sha1_git": "142be7fc206e9d06d5cf62f6500ef987c0441087",
            "sha256": "e1cae1ee5536e97f2d823023a7e141d92b3f33711b0d6bf57a967efdc3d6fdc1"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 4289021,
        "name": "svnmap.txt",
        "perms": 33188,
        "status": "visible",
        "target": "142be7fc206e9d06d5cf62f6500ef987c0441087",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:142be7fc206e9d06d5cf62f6500ef987c0441087/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "b9d4502487bcc7365bcec6c1dddd49c7e2bc36fd",
            "sha1_git": "e612555b6d3acedc1a51b1c6662f00566b1a8725",
            "sha256": "58ee37b0ad37ccdc87d5a08b4dc17ef52df2e7be8b5fd9be6c96c26314198b98"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 8364,
        "name": "valgrind-python.supp",
        "perms": 33188,
        "status": "visible",
        "target": "e612555b6d3acedc1a51b1c6662f00566b1a8725",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:e612555b6d3acedc1a51b1c6662f00566b1a8725/",
        "type": "file"
    },
    {
        "checksums": {
            "sha1": "a5c84a69a1dfc2159222cdca89d87173fc2c6d6d",
            "sha1_git": "3e6d8a4629a4550fd18e3762da6e0ba6a207de14",
            "sha256": "7ff436bbe3656eb6fc0e3c076bb4b6b4b3eaf2e94a8d4821653223a7cfee467b"
        },
        "dir_id": "6d8ce40edd85daec3653450f3b9220c135acdaca",
        "length": 500,
        "name": "vgrindefs",
        "perms": 33188,
        "status": "visible",
        "target": "3e6d8a4629a4550fd18e3762da6e0ba6a207de14",
        "target_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:3e6d8a4629a4550fd18e3762da6e0ba6a207de14/",
        "type": "file"
    }
]

URL Allowed Methods

https://archive.softwareheritage.org/api/1/directory/ (sha1_git) /[ (path) /]

GET, HEAD, OPTIONS

Arguments

sha1_git (string)

hexadecimal representation of the directory sha1_git identifier

path (string)

optional parameter to get information about the directory entry pointed by that relative path


Request headers

Accept

the requested response content type, either application/json (default) or application/yaml


Response headers

Content-Type

this depends on Accept header of request


Returns

array

an array of objects containing the following keys:

  • checksums (object): object holding the computed checksum values for a directory entry (only for file entries)

  • dir_id (string): sha1_git identifier of the requested directory

  • length (number): length of a directory entry in bytes (only for file entries) for getting information about the content MIME type

  • name (string): the directory entry name

  • perms (number): permissions for the directory entry

  • target (string): sha1_git identifier of the directory entry

  • target_url (string): link to /api/1/content/ or /api/1/directory/ depending on the directory entry type

  • type (string): the type of the directory entry, can be either dir, file or rev


HTTP status codes

200

no error

400

an invalid hash_type or hash has been provided

404

requested directory cannot be found in the archive


Examples

/api/1/directory/977fc4b98c0e85816348cebd3b12026407c368b6/
back to top