Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to implement an external Interface in OpenStack4j

Shulou Source: shulou.com Published: 2022-06-01 14:39:33 10月01日 Update

It is believed that many inexperienced people have no idea about how to implement an external interface in OpenStack4j. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Add maven dependency package org.pacesys openstack4j 3.0.3 withdeps to the project through permission authentication import org.openstack4j.api.OSClient.OSClientV3;import org.openstack4j.openstack.OSFactory;import org.openstack4j.model.common.Identifier;# use Identifier.byId ("domainId") or Identifier.byName ("example-domain") Identifier domainIdentifier = Identifier.byId ("domainId") # unscoped authentication# as the username is not unique across domains you need to provide the domainIdentifierOSClientV3 os = OSFactory.builderV3 () .authenticate ("http://127.0.0.1:5000/v3") .authentication (" admin "," sample ", domainIdentifier) .authenticate () # project scoped authenticationOSClientV3 os = OSFactory.builderV3 () .authenticate ("http://127.0.0.1:5000/v3") .authentication (" admin "," secret ", Identifier.byName (" example-domain ")) .scopeToProject (Identifier.byId (projectIdentifier)) .authenticate () # domain scoped authentication# using the unique userId does not require a domainIdentifierOSClientV3 os = OSFactory.builderV3 () .authentication ("http://127.0.0.1:5000/v3"). Domains (" userId "," secret ") .scopeToDomain (Identifier.byId (domainIdentifier)) .authenticate (); # Scoping to a project just by name isn't possible as the project name is only unique within a domain. # You can either use this as the id of the project is unique across domains OSClientV3 os = OSFactory.builderV3 () .authenticate ("http://127.0.0.1:5000/v3") .authentication (" userId "," secret ") .scopeToProject (Identifier.byName (projectName), Identifier.byName (domainName)) .authenticate () # Or alternatively OSClientV3 os = OSFactory.builderV3 () .authentication ("http://127.0.0.1:5000/v3") .domains (" userId "," secret ") .scopeToDomain (Identifier.byName (domainName)) .authenticate (); common module calls / / Find all UsersList

Tags: Interface external content method more problem helpless for this reason commonly used skills permissions modules articles experience industry information channels projects Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia MySQL Linux Huawei Microsoft