{"id":22394342,"url":"https://github.com/akamai/netstoragekit-ruby","last_synced_at":"2025-10-20T00:00:09.542Z","repository":{"id":56885373,"uuid":"60019685","full_name":"akamai/NetStorageKit-Ruby","owner":"akamai","description":"Akamai NetStorage API for Ruby","archived":false,"fork":false,"pushed_at":"2024-03-25T15:48:10.000Z","size":28,"stargazers_count":8,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-28T05:45:22.385Z","etag":null,"topics":["akamai","akamai-netstorage","akamai-open","filestore","netstorage-api","netstoreage","objectstore","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akamai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-30T15:18:24.000Z","updated_at":"2022-08-24T14:14:42.000Z","dependencies_parsed_at":"2022-08-20T13:00:27.247Z","dependency_job_id":null,"html_url":"https://github.com/akamai/NetStorageKit-Ruby","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/akamai/NetStorageKit-Ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamai%2FNetStorageKit-Ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamai%2FNetStorageKit-Ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamai%2FNetStorageKit-Ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamai%2FNetStorageKit-Ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akamai","download_url":"https://codeload.github.com/akamai/NetStorageKit-Ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akamai%2FNetStorageKit-Ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274390540,"owners_count":25276406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["akamai","akamai-netstorage","akamai-open","filestore","netstorage-api","netstoreage","objectstore","ruby"],"created_at":"2024-12-05T05:09:48.178Z","updated_at":"2025-10-20T00:00:04.480Z","avatar_url":"https://github.com/akamai.png","language":"Ruby","readme":"NetstorageAPI: Akamai Netstorage API for Ruby\n===============================================\n\n[![Gem Version](https://badge.fury.io/rb/netstorageapi.svg)](https://badge.fury.io/rb/netstorageapi)\n[![Build Status](https://travis-ci.org/akamai/NetStorageKit-Ruby.svg?branch=master)](https://travis-ci.org/akamai/NetStorageKit-Ruby)\n[![License](http://img.shields.io/:license-apache-blue.svg)](https://github.com/akamai/NetStorageKit-Ruby/blob/master/LICENSE)\n\n  \nNetstorageAPI is Akamai Netstorage (File/Object Store) API for Ruby 2.0+.\n\nImportant\n------------\n\nAkamai does not maintain or regulate this package. While it can be incorporated to assist you in API use, Akamai Technical Support will not offer assistance and Akamai cannot be held liable if issues arise from its use. \n\nInstallation\n------------\n\nTo install Netstorage API for Ruby:  \n\n```bash\n$ gem install netstorageapi\n```\n  \n  \nExample\n-------\n\n```ruby\n\u003e require \"akamai/netstorage\"\n\u003e \n\u003e NS_HOSTNAME = \"astinobj-nsu.akamaihd.net\"\n\u003e NS_KEYNAME = \"astinobj\"\n\u003e NS_KEY = \"xxxxxxxxxx\" # Don't expose NS_KEY on public repository.\n\u003e NS_CPCODE = \"407617\"\n\u003e \n\u003e ns = Akamai::Netstorage.new(NS_HOSTNAME, NS_KEYNAME, NS_KEY, ssl=false) # ssl is optional (default: false)\n\u003e local_source = \"hello.txt\"\n\u003e netstorage_destination = \"/#{NS_CPCODE}/hello.txt\" # or \"/#{NS_CPCODE}/\" is same.\n\u003e\n\u003e ok, response = ns.upload(local_source, netstorage_destination)\n=\u003e [true, \u003c#Net::HTTPOK 200 OK readbody=true\u003e] # true means 200 OK; If false, it's not 200 OK \n\u003e response.body\n=\u003e \"\u003cHTML\u003eRequest Processed\u003c/HTML\u003e\\n\"\n```\n  \n  \nMethods\n-------\n\n```ruby\n\u003e ns.delete(NETSTORAGE_PATH)\n\u003e\n\u003e dir_option = {\n*  :max_entries =\u003e INTEGER,\n*  :start =\u003e '/start/path',\n*  :end =\u003e '/end/path/',\n*  :prefix =\u003e 'object-prefix',\n*  :slash =\u003e 'both',\n*  :encoding =\u003e 'utf-8'\n* }\n\u003e ns.dir(NETSTORAGE_PATH, dir_option)\n\u003e ns.download(NETSTORAGE_SOURCE, LOCAL_DESTINATION)\n\u003e ns.du(NETSTORAGE_PATH)\n\u003e\n\u003e list_option = {\n*  :max_entries =\u003e INTEGER,\n*  :end =\u003e '/end/path/',\n*  :encoding =\u003e 'utf-8'\n* }\n\u003e ns.list(NETSTORAGE_PATH, list_option)\n\u003e ns.mkdir(\"#{NETSTORAGE_PATH}/#{DIRECTORY_NAME}\")\n\u003e ns.mtime(NETSTORAGE_PATH, TIME) # ex) TIME: Time.now.to_i\n\u003e ns.quick_delete(NETSTORAGE_DIR) # needs to the privilege on the CP Code\n\u003e ns.rename(NETSTORAGE_TARGET, NETSTORAGE_DESTINATION)\n\u003e ns.rmdir(NETSTORAGE_DIR) # remove empty direcoty\n\u003e ns.stat(NETSTORAGE_PATH)\n\u003e ns.symlink(NETSTORAGE_TARGET, NETSTORAGE_DESTINATION)\n\u003e ns.upload(LOCAL_SOURCE, NETSTORAGE_DESTINATION, index_zip=false)\n\u003e  \n\u003e # INFO: return (true/false, Net::HTTP.. Object)\n\u003e #               true means 200 OK.\n\u003e # INFO: can \"upload\" Only a single file, not directory.\n\u003e #       To use 'INDEX_ZIP=True',\n\u003e #       Must turn on index_zip on your Netstorage configuration.\n\u003e # WARN: Can raise Akamai::NetstorageError from all methods.\n```\n  \n  \nTest\n----\n\nYou can test all above methods with [unittest script](https://github.com/AstinCHOI/NetStorageKit-Ruby/blob/master/test_netstorage.rb)\n(NOTE: You should input NS_HOSTNAME, NS_KEYNAME, NS_KEY and NS_CPCODE in the script):\n\n```bash\n$ ruby test/test_netstorage.rb\nLoaded suite test/test_netstorage\nStarted\n[TEST] dir /407617 done\n[TEST] list /407617 done\n[TEST] mkdir /407617/6d50bfa3-ea6e-4112-84ae-7ca9edce104e done\n[TEST] upload 439a5ab1-9b44-4520-bef9-ccd817fd294a.txt to /407617/6d50bfa3-ea6e-4112-84ae-7ca9edce104e/439a5ab1-9b44-4520-bef9-ccd817fd294a.txt done\n[TEST] du done\n[TEST] mtime /407617/6d50bfa3-ea6e-4112-84ae-7ca9edce104e/439a5ab1-9b44-4520-bef9-ccd817fd294a.txt to 1528347989 done\n[TEST] stat done\n[TEST] symlink /407617/6d50bfa3-ea6e-4112-84ae-7ca9edce104e/439a5ab1-9b44-4520-bef9-ccd817fd294a.txt to /407617/6d50bfa3-ea6e-4112-84ae-7ca9edce104e/439a5ab1-9b44-4520-bef9-ccd817fd294a.txt_lnk done\n[TEST] rename /407617/6d50bfa3-ea6e-4112-84ae-7ca9edce104e/439a5ab1-9b44-4520-bef9-ccd817fd294a.txt to /407617/6d50bfa3-ea6e-4112-84ae-7ca9edce104e/439a5ab1-9b44-4520-bef9-ccd817fd294a.txt_rename done\n[TEST] download /407617/6d50bfa3-ea6e-4112-84ae-7ca9edce104e/439a5ab1-9b44-4520-bef9-ccd817fd294a.txt_rename done\n[TEST] delete /407617/6d50bfa3-ea6e-4112-84ae-7ca9edce104e/439a5ab1-9b44-4520-bef9-ccd817fd294a.txt_rename done\n[TEST] delete /407617/6d50bfa3-ea6e-4112-84ae-7ca9edce104e/439a5ab1-9b44-4520-bef9-ccd817fd294a.txt_lnk done\n[TEST] rmdir /407617/6d50bfa3-ea6e-4112-84ae-7ca9edce104e done\n[TEARDOWN] remove 439a5ab1-9b44-4520-bef9-ccd817fd294a.txt from local done\n[TEARDOWN] remove 439a5ab1-9b44-4520-bef9-ccd817fd294a.txt_rename from local done\n.\n[TEST] Invalid ns path NetstorageError test done\n[TEST] Invalid upload local path NetstorageError test done\n[TEST] Download directory path NetstorageError test done\n.\nFinished in x.xxxxxx seconds.\n--------------------------------------------------------------------------------------\n2 tests, 16 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications\n100% passed\n--------------------------------------------------------------------------------------\nx.xx tests/s, x.xx assertions/s\n```\n  \n  \nCommand\n-------\n\nYou can run the [script](https://github.com/AstinCHOI/NetStorageKit-Ruby/blob/master/cms_netstorage.rb) with command line parameters.\n\n```bash\n$ ruby cms_netstorage.rb -H astin-nsu.akamaihd.net -k astinapi -K xxxxxxxxxx -a dir /407617\n```\n  \nUse -h or --help option for more detail.\n  \n  \nAuthor\n------\n\nAstin Choi (achoi@akamai.com)  \n  \n  \nLicense\n-------\n\nCopyright 2018 Akamai Technologies, Inc.  All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakamai%2Fnetstoragekit-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakamai%2Fnetstoragekit-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakamai%2Fnetstoragekit-ruby/lists"}