Skip to content

qingstor-incubating/qingstor-sdk-scala

Repository files navigation

QingStor SDK for Scala

Build Status API Reference License

the official QingStor SDK for the Scala programing language

Getting Started

Installation

Refer to the Installation Guide, and have this SDK installed.

Preparation

Before your start, please go to QingCloud Console to create a pair of QingCloud API AccessKey.

API AccessKey Example:

access_key_id: 'ACCESS_KEY_ID_EXAMPLE'
secret_access_key: 'SECRET_ACCESS_KEY_EXAMPLE'

Usage

Now you are ready to code. You can read the detailed guides in the list below to have a clear understanding or just take the quick start code example.

Checkout our releases and change log for information about the latest features, bug fixes and new ideas.

Quick Start Code Example:

package demo

import com.qingstor.sdk.config.QSConfig
import com.qingstor.sdk.service.QingStor

import scala.concurrent.Await
import scala.concurrent.duration.Duration

object Demo extends App {
  val config = QSConfig("ACCESS_KEY_ID", "SECRET_ACCESS_KEY")

  // Initialize service object for QingStor.
  val qsService = QingStor(config)

  // List all buckets.
  val outputFuture = qsService.listBuckets(QingStor.ListBucketsInput())
  val listBucketsOutput = Await.result(outputFuture, Duration.Inf)

  // Print HTTP status code.
  println(listBucketsOutput.statusCode.getOrElse(-1))

  // Print the count of buckets.
  println(listBucketsOutput.count.getOrElse(-1))

  // Print the first bucket name.
  println(listBucketsOutput.buckets.flatMap(_.head.name).getOrElse("No buckets"))
  
  System.exit(0)
}

Reference Documentations

Contributing

  1. Fork it ( https://github.com/yunify/qingstor-sdk-scala/fork )
  2. Create your feature branch (git checkout -b new-feature)
  3. Commit your changes (git commit -asm 'Add some feature')
  4. Push to the branch (git push origin new-feature)
  5. Create a new Pull Request

LICENSE

The Apache License (Version 2.0, January 2004).

HISTORY

This project was originally developed by Cheerx as a third-party QingStor SDK for Scala. Later on, it was accepted to be the official QingStor SDK for Scala by QingStor team. It will be maintained by both QingStor team and Cheerx.