copyright | lastupdated | keywords | subcollection | ||
---|---|---|---|---|---|
|
2024-07-24 |
developer, getting started, command line interface, cli |
cloud-object-storage |
{{site.data.keyword.attribute-definition-list}}
{: #gs-dev}
The powerful features of {{site.data.keyword.cos_full}} are available to a developer directly from the command line. {: shortdesc}
First, ensure that you have the {{site.data.keyword.cloud}} Platform CLI and IBM Developer Tools installed.
{: #gs-dev-provision}
-
First, make sure that you have an API key. Get it from IBM Cloud Identity and Access Management.
-
Log in to {{site.data.keyword.cloud_notm}} Platform by using the CLI. It's also possible to store the API key in a file or set it as an environment variable.
ibmcloud login --apikey <value>
{: pre}
-
Next, create an instance of {{site.data.keyword.cos_full_notm}} specifying the name for the instance and the Standard plan (see Choosing a plan and creating an instance). Now you have a CRN for the instance.
ibmcloud resource service-instance-create <instance-name> cloud-object-storage <plan> global
{: pre}
When trying to create a new instance, if you encounter the error No resource group targeted
, it indicates that the default resource group is not available and that a resource group must be explicitly set. A list of available resource groups can be found using ibmcloud resource groups
and the target can be set with ibmcloud target -g <resource-group>
.
{: tip}
The Getting Started guide walks through the basic steps of creating buckets and objects, as well as inviting users and creating policies. A list of basic 'curl' commands can be found here.
Learn more about using the {{site.data.keyword.cloud_notm}} CLI to create applications, manage Kubernetes clusters, and more in the documentation.
{: #gs-dev-api}
For managing data stored in {{site.data.keyword.cos_short}}, you can use S3 API compatible tools like the AWS CLI with HMAC credentials for compatibility. As IAM tokens are relatively easy to work with, curl
is a good choice for basic testing and interaction with your storage. More information can be found in the curl
and the API documentation.
{: #gs-dev-sdk}
IBM COS SDKs are available for Python, Java, Go, and Node.js. These libraries are forked and modified versions of the AWS S3 SDKs that support IAM token-based authentication, as well as support for Key Protect.
{: #gs-dev-apps}
{{site.data.keyword.cloud}} provides flexibility to developers in choosing the right architectural and deployment options for a given application. Run your code on bare metal, in virtual machines, in containers, or by using a serverless framework.
The Cloud Native Computing Foundation fostered Kubernetes container orchestration framework, which forms the foundation for the {{site.data.keyword.cloud}} Kubernetes Service. Developers who want to use Object Storage for persistent storage in their Kubernetes applications can learn more at the following links: