Interacting with IBM Cloud
Tags: cloud, webconsole, sdk, cli
Published: 2021-03-29 16:20:23

Many people think the best and only way to interact with a cloud vendor is via the web browser.

I do not disagree that it is a great method, but it isn't the only way and in some cases it might not be the best way. This article  will outline the 3 main ways you can interact with IBM Cloud services. If you don't already have an account, you can [sign up](https://ibm.biz/BdfY5S) for a free tier Lite account and try them for yourself.

**1 - Web browser cloud management console**
The web browser is great for visualising what you are doing in your cloud account. Here you can visit your account dashboard with an overview of active and inactive services, keep up to date with recent IBM news and gain access to quick start templates. By using this method, you will feel more in control of what you are doing and therefore put aside any axiety of spending cloud credits by accident or starting the wrong service with the wrong resources.

Pros:
- Visualise your workload
- Feel more in control
- Easily find quick start guides
- Easily calculate costs with available tools

Cons:
- Time consuming
- Repetitive tasks become arduous
- Can take time to get used to the console layout

Example use case: If you wish to set up a 30 days free Kubernetes cluster and visualise the progress and visit the Kubernetes dashboard this would be a great method of interaction.

![IBM Cloud Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0dkrntn8dt5ef714cfej.png)

**2 - Command Line Interface (CLI)**
Using a CLI is great for efficiency, once logged into the CLI you have access to IBM Cloud services via the API's. If you are using this method, you may already know what services you are wanting to use and how to use them. That being said, even if you don't you can always find your way through the plain text interface by using the `-h` flag. I find the best part about cloud vendor CLI's is more often than not they will be available within a Docker container. For example, [IBM Cloud Developer Tools](https://hub.docker.com/r/ibmcom/ibm-cloud-developer-tools-amd64). This makes them super portable and doesn't require you to install them onto your local machine. Second to that, some even have a CLI integrated into the browser that allows you to use the CLI through a browser window. If you have an IBM Cloud Account then you can visit and use the [IBM Cloud Shell](https://cloud.ibm.com/shell) to interact with yours.

Pros:
- Great for repetitive tasks (you can write scripts around them)
- Can be containerised
- Standard layout
- Quick implementations

Cons:
- Not every product offering will have an API or have a specific command embedded into the released CLI
- No visual representation of actions
- Usually require some level of command line confidence

Example use case: You are wanting to create a new IBM Cloud Function with an Action and a Trigger to process a batch job on request.

![IBM Cloud CLI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ojzgd6evrvcd7pre1z3.png)

**3 - Software Development Kit's (SDK's)**
This one is less frequently used and less frequently spoken about. Thus making it the method most often forgotten about. An SDK is a set of tools and libraries that you can directly inject into your own source code of your chosen language to create and communicate between applications. Certain product offerings will have their own specific SDK's. An SDK usually contains many API's. There is an amazing video explaining the difference between API's and SDK's - https://www.youtube.com/watch?v=kG-fLp9BTRo

You can see the [IBM Cloud API's and SDK's](https://cloud.ibm.com/docs?tab=api-docs&) list showing which product offerings have an associated SDK ready for you to use.

Pros:
- Language specific
- Lots of SDK's available
- Great to import and use straight away

Cons:
- Can be difficult to understand
- Can be large in size
- Sometimes challenging to work out if you need one or not

Example use case: You have written a Go program and want to interact directly with IBM Watson. You can use the Go SDK to do this.

For this example you would install it with the following bash command (this is just the starting point for the purpose of this article and not a complete code example):

```bash
$ go get -u github.com/watson-developer-cloud/go-sdk/v2
```

And to use it, it needs to be imported it into your application code directly:

```go
import "github.com/watson-developer-cloud/go-sdk/v2/servicev1"

service, serviceErr := servicev1.NewServiceV1(&servicev1.ServiceV1Options{
	Version:   "2018-03-05",
})
```

If you have any questions or want to see more content like this, drop me a line!

[GitHub](https://github.com/liamchampton)
[Twitter](https://twitter.com/liamchampton)
[Instagram](https://www.instagram.com/liamhampton/)
[LinkedIn](www.linkedin.com/in/liam-conroy-hampton)