Giter Site home page Giter Site logo

xuqianjin-stars / huaweicloud-cs-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from huaweicloudsdk/huaweicloud-cs-sdk

0.0 3.0 0.0 2.54 MB

Move to https://github.com/huaweicloud/huaweicloud-cs-sdk. Huawei Cloud Stream Service SDK for Java and Scala.

License: Apache License 2.0

Java 86.21% Scala 13.62% Shell 0.17%

huaweicloud-cs-sdk's Introduction

Huawei Cloud CS SDK for Scala and Java

The Huawei Cloud CS Sdk enables Scala and Java developers to easily work with Huawei Cloud CS. You can get started in minutes using Maven or sbt.

Quick links:

SDK

  • huaweicloud-cs-java-sdk is for Java
  • huaweicloud-cs-scala-sdk is for Scala

Deploy to OSS

GPG_TTY=$(tty);export GPG_TTY;mvn clean deploy -Dgpg.passphrase=xxxx

add the distributionManagement to the pom. # todo add deploy script

<distributionManagement>
    <snapshotRepository>
        <id>oss-snapshot</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
        <id>oss-release</id>
        <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
</distributionManagement>

User authorization

Before invoking CS SDK, you need to use \src\main\java\com\huaweicloud\cs\utils to get user token or ak/sk authorization info.

  • get user authorization to a JSON object which includes token and ak/sk

For example:

...
import com.huaweicloud.cs.utils.UserAuthUtil;
import com.google.gson.JsonObject;
...
//get token and AK/SK
JsonObject authObject = userAuthUtil.getUserAuth(
                csConfig.get("DomainName", null),
                csConfig.get("UserName", null),
                csConfig.get("Password", null),
                csConfig.get("ProjectId", null));
String xAuthToken = authObject.get("token").getAsString();
String ak = authObject.get("ak").getAsString();
String sk = authObject.get("sk").getAsString();

//create API client
ApiClient apiClient = new ApiClient();

//disable SSL verify
apiClient.setVerifyingSsl(false);

//set token or AK/SK authentication method
apiClient.setToken(xAuthToken);
//apiClient.setAksk(region, ak, sk);
...

Licence

Apache License 2.0

huaweicloud-cs-sdk's People

Contributors

shijinkui avatar barcahead avatar zhoufenglan avatar

Watchers

James Cloos avatar ForwardXu avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.