{"id":23117020,"url":"https://github.com/assistanz/openstack4j-api","last_synced_at":"2025-09-02T06:41:45.695Z","repository":{"id":30213198,"uuid":"33764191","full_name":"assistanz/Openstack4j-Api","owner":"assistanz","description":null,"archived":false,"fork":false,"pushed_at":"2015-04-11T05:40:36.000Z","size":1716,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-03T04:24:30.322Z","etag":null,"topics":["openstack"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/assistanz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-11T05:38:47.000Z","updated_at":"2017-03-28T11:44:28.000Z","dependencies_parsed_at":"2022-09-05T01:01:15.985Z","dependency_job_id":null,"html_url":"https://github.com/assistanz/Openstack4j-Api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/assistanz/Openstack4j-Api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assistanz%2FOpenstack4j-Api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assistanz%2FOpenstack4j-Api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assistanz%2FOpenstack4j-Api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assistanz%2FOpenstack4j-Api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/assistanz","download_url":"https://codeload.github.com/assistanz/Openstack4j-Api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assistanz%2FOpenstack4j-Api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273244305,"owners_count":25070958,"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-02T02:00:09.530Z","response_time":77,"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":["openstack"],"created_at":"2024-12-17T04:18:16.654Z","updated_at":"2025-09-02T06:41:45.668Z","avatar_url":"https://github.com/assistanz.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"OpenStack4j \n===========\n\n[![Build Status](https://travis-ci.org/gondor/openstack4j.svg?branch=master)](https://travis-ci.org/gondor/openstack4j)  [![License](https://pypip.in/license/apache-libcloud/badge.png)]()\n\n\nOpenStack4j is a fluent OpenStack client that allows provisioning and control of an OpenStack deployment.   This includes support for Identity, Compute, Image, Network, Block Storage, Telemetry and more.\n\n## Documentation and Support\n\n* Website: [OpenStack4j.com](http://www.openstack4j.com)\n* Documentation/Tutorials: [OpenStack4j.com/learn/](http://www.openstack4j.com/learn/)\n* Questions - Use Google Groups: [groups.google.com/group/openstack4j](http://groups.google.com/group/openstack4j)\n* Questions - Stackoverflow use **openstack4j** tag\n* Twitter: [@openstack4j](https://twitter.com/openstack4j)\n* Facebook: [facebook.com/openstack4j](http://www.facebook.com/openstack4j)\n* Changelog: [Changelog](https://github.com/gondor/openstack4j/blob/master/CHANGELOG.md)\n\n## Bug Reports\n\n* GitHub Issues: [/gondor/openstack4j/issues](https://github.com/gondor/openstack4j/issues)\n\nMaven\n-----\n\n#### Latest Release (Stable)\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.pacesys/openstack4j/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.pacesys/openstack4j)\n\nOpenStack4j version 2.0.0+ is now modular.  One of the benefits to this is the ability to choose the connector that you would like to use in your environment.  \n\n**Using OpenStack4j with the default Jersey2 Connector**\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.pacesys\u003c/groupId\u003e\n    \u003cartifactId\u003eopenstack4j\u003c/artifactId\u003e\n    \u003cversion\u003e2.0.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n**Using OpenStack4j with one of our connector modules**\n\nTo configure OpenStack4j to use one of our supported connectors (Jersey 2, Resteasy, Apache HttpClient, OKHttp) [see the usage guide](https://github.com/gondor/openstack4j/tree/master/connectors)\n\n#### Current (Master Branch)\n\nSee notes above about connectors (same rules apply) to development branches.  \n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.pacesys\u003c/groupId\u003e\n    \u003cartifactId\u003eopenstack4j\u003c/artifactId\u003e\n    \u003cversion\u003e2.0.3-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n**A note about referencing Snapshots without Source**\n\nSnapshots are deploys to sonatype.  You will need to add the repository to your POM or Settings file.  Releases (above) are deployed to maven central and this step is not required.\n\nExample POM based repository declaration to grab snapshots:\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n      \u003cid\u003est-snapshots\u003c/id\u003e\n      \u003cname\u003esonatype-snapshots\u003c/name\u003e\n      \u003curl\u003ehttps://oss.sonatype.org/content/repositories/snapshots\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\nQuick Usage Guide\n-----------------\n\nBelow are some examples of the API usage.  Please visit [www.OpenStack4j.com](http://www.openstack4j.com) for the full manual and getting started guides.\n\n\n### Authenticating\n\nCreating and authenticating against OpenStack is extremely simple. Below is an example of authenticating which will\nresult with the authorized OSClient.  OSClient allows you to invoke Compute, Identity, Neutron operations fluently. \n\n```java\nOSClient os = OSFactory.builder()\n                       .endpoint(\"http://127.0.0.1:5000/v2.0\")\n                       .credentials(\"admin\",\"sample\")\n                       .tenantName(\"admin\")\n                       .authenticate();\n```\n\n#### Identity Operations (Keystone)\n\nAfter successful authentication you can invoke any Identity (Keystone) directly from the OSClient. \n\nIdentity Services fully cover Tenants, Users, Roles, Services, Endpoints and Identity Extension listings.  The examples below are only a small fraction of the existing API so please refer to the API documentation for more details.\n\n**Create a Tenant, User and associate a Role**\n```java\n// Create a Tenant (could also be created fluent within user create)\nTenant tenant = os.identity().tenants().create(Builders.tenant().name(\"MyNewTenant\").build());\n\n// Create a User associated to the new Tenant\nUser user = os.identity().users().create(Builders.user().name(\"jack\").password(\"sample\").tenant(tenant).build());\n\n// Add a Tenant based Role to the User\nos.identity().roles().addUserRole(tenant.getId(), user.getId(), os.identity().roles().getByName(\"Member\").getId());\n\n```\n\n\n### Compute Operations (Nova)\n\nOpenStack4j covers most the major common compute based operations.  With the simplistic API approach you can fully manage Servers, Flavors, Images, Quota-Sets, Diagnostics, Tenant Usage and more.  As the API evolves additional providers and extensions will be covered and documented within the API.\n\n**Create a Flavor and Boot a Server/VM**\n```java\n// Create a Flavor for a special customer base\nFlavor flavor = os.compute().flavors()\n                  .create(Builders.flavor().name(\"Gold\").vcpus(4).disk(80).ram(2048).build());\n                  \n// Create and Boot a new Server (minimal builder options shown in example)\nServer server = os.compute().servers()\n                  .boot(Builders.server().name(\"Ubuntu 2\").flavor(flavor.getId()).image(\"imageId\").build());\n\n```\n\n**Create a new Server Snapshot**\n```java\nString imageId = os.compute().servers().createSnapshot(server.getId(), \"Clean State Snapshot\");\n```\n\n**Server Diagnostics**\n\nDiagnostics are usage information about the server.  Usage includes CPU, Memory and IO.  Information is\ndependant on the hypervisor used by the OpenStack installation.  As of right now there is no concrete diagnostic\nspecification which is why the information is variable and in map form (key and value)\n```java\nMap\u003cString, ? extends Number\u003e diagnostics = os.compute().servers().diagnostics(\"serverId\");\n```\n\n\n### Networks (Neutron)\n\n**Network Operations**\n```java\n// List the networks which the current authorized tenant has access to\nList\u003c? extends Network\u003e networks = os.networking().network().list();\n\n// Create a Network\nNetwork network = os.networking().network()\n                    .create(Builders.network().name(\"MyNewNet\").tenantId(tenant.getId()).build());\n```\n\n**Subnet Operations**\n```java\n// List all subnets which the current authorized tenant has access to\nList\u003c? extends Subnet\u003e subnets = os.networking().subnet().list();\n\n// Create a Subnet\nSubnet subnet = os.networking().subnet().create(Builders.subnet()\n                  .name(\"MySubnet\")\n                  .networkId(\"networkId\")\n                  .tenantId(\"tenantId\")\n                  .addPool(\"192.168.0.1\", \"192.168.0.254\")\n                  .ipVersion(IPVersionType.V4)\n                  .cidr(\"192.168.0.0/24\")\n                  .build());\n```\n\n**Router Operations**\n```java\n// List all Routers \nList\u003c? extends Router\u003e = os.networking().router().list();\n\n// Create a Router\nRouter router = os.networking().router().create(Builders.router()\n                  .name(\"ext_net\").adminStateUp(true).externalGateway(\"networkId\").build());\n                  \n```\n\n### Image Operations (Glance)\n\n**Basic Operations**\n```java\n// List all Images\nList\u003c? extends Image\u003e images = os.images().list();\n\n// Get an Image by ID\nImage image = os.images().get(\"imageId\");\n\n// Delete a Image\nos.images().delete(\"imageId\");\n\n// Update a Image\nImage image = os.images().get(\"imageId\");\n\nos.images().update(image.toBuilder()\n           .name(\"New VM Image Name\").minDisk(1024).property(\"personal-distro\", \"true\"));\n```\n\n**Download the Image Data**\n```java\nInputStream is = os.images().getAsStream(\"imageId\"); \n```\n\n**Create a Image**\n```java\n// (URL Payload in this example, File, InputStream are other payloads available)\nImage image = os.images().create(Builders.image()\n                .name(\"Cirros 0.3.0 x64\")\n\t\t\t\t.isPublic(true)\n\t\t\t\t.containerFormat(ContainerFormat.BARE)\n\t\t\t\t.diskFormat(DiskFormat.QCOW2)\n\t\t\t\t.build()\n\t\t\t\t), Payloads.create(new URL(\"https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img\")));\n```\n\nContributing\n------------\nIf you would like to contribute please see our contributing [guidelines](https://github.com/gondor/openstack4j/blob/master/CONTRIBUTING.md)\n\nLicense\n-------\n```\nThis software is licensed under the Apache 2 license, quoted below.\n\nCopyright 2014 Jeremy Unruh and OpenStack4j\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe 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, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassistanz%2Fopenstack4j-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fassistanz%2Fopenstack4j-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassistanz%2Fopenstack4j-api/lists"}