File tree Expand file tree Collapse file tree 3 files changed +27
-6
lines changed
Expand file tree Collapse file tree 3 files changed +27
-6
lines changed Original file line number Diff line number Diff line change 22
33# get the current resource group name
44resource_group_name=$( ibmcloud target -o JSON | jq -r ' .resource_group.name' )
5+ cos_instance=${resource_group_name/ --rg/ } --cos
6+
7+ echo " switching to COS instance $cos_instance "
58
69# configure the COS instance
7- crn=$( ibmcloud resource service-instances -o json | jq -r ' .[] | select( .name | contains("--cos")) | .crn' )
8- ibmcloud cos config crn --crn $crn
10+ crn=$( ibmcloud resource service-instance " ${cos_instance} " -o json | jq -r ' .[] | .crn' )
11+
12+ ibmcloud cos config crn --crn $crn --force
913
1014# get the bucket names
1115output_bucket=$( ibmcloud cos buckets --json | jq -r ' .Buckets[] | select( .Name | contains("output")) | .Name' )
Original file line number Diff line number Diff line change 22
33# get the current resource group name
44resource_group_name=$( ibmcloud target -o JSON | jq -r ' .resource_group.name' )
5+ cos_instance=${resource_group_name/ --rg/ } --cos
6+
7+ echo " switching to COS instance $cos_instance "
58
69# configure the COS instance
7- crn=$( ibmcloud resource service-instances -o json | jq -r ' .[] | select( .name | contains("--cos")) | .crn' )
8- ibmcloud cos config crn --crn $crn
10+ crn=$( ibmcloud resource service-instance " ${cos_instance} " -o json | jq -r ' .[] | .crn' )
11+
12+ ibmcloud cos config crn --crn $crn --force
913
1014# get the bucket names
1115output_bucket=$( ibmcloud cos buckets --json | jq -r ' .Buckets[] | select( .Name | contains("output")) | .Name' )
Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- crn=$( ibmcloud resource service-instances -o json | jq -r ' .[] | select( .name | contains("--cos")) | .crn' )
4- ibmcloud cos config crn --crn $crn
3+ # get the current resource group name
4+ resource_group_name=$( ibmcloud target -o JSON | jq -r ' .resource_group.name' )
5+ region=$( ibmcloud target -o JSON | jq -r ' .region.name' )
6+ cos_instance=${resource_group_name/ --rg/ } --cos
7+
8+ echo " switching to COS instance $cos_instance "
9+
10+ # configure the COS instance
11+ crn=$( ibmcloud resource service-instance " ${cos_instance} " -o json | jq -r ' .[] | .crn' )
12+
13+ ibmcloud cos config crn --crn $crn --force
14+ ibmcloud cos config endpoint-url --url s3.$region .cloud-object-storage.appdomain.cloud
15+
516bucket=$( ibmcloud cos buckets --json | jq -r ' .Buckets[] | select( .Name | contains("output")) | .Name' )
617
18+ echo $bucket
19+
720watch -n 2 ibmcloud cos list-objects-v2 --bucket " $bucket " --prefix " $1 "
You can’t perform that action at this time.
0 commit comments