2 #######################################################################################
3 # Copyright ETSI Contributors and Others.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #######################################################################################
20 if [ "${CLOUD_TYPE}" == "azure" ]; then
21 echo "Adding VIM to OSM"
23 osm vim-create
--name "$VIM_TARGET" --account_type "$CLOUD_TYPE" --auth_url http
://www.azure.com \
24 --user "$AZURE_CLIENT_ID" --password "$AZURE_SECRET" --tenant "$AZURE_TENANT" --description "None" \
25 --config "{region_name: '$AZURE_REGION', resource_group: '$RESOURCE_GROUP',
26 subscription_id: '$AZURE_SUBSCRIPTION_ID', vnet_name: '$VNET_NAME',
27 flavors_pattern: '$AZURE_FLAVORS_PATTERN'}"
29 osm vim-show
"$VIM_TARGET"
30 elif [ "${CLOUD_TYPE}" == "gcp" ]; then
31 echo "CLOUD_TYPE '${CLOUD_TYPE}' still not supported"
34 echo "CLOUD_TYPE '${CLOUD_TYPE}' not valid"
38 # Add SDN controller to OSM
39 if [ -n "$SDNC_TYPE" ] && [ -n "$SDNC_USER" ] && [ -n "$SDNC_URL" ]; then
40 echo "Adding $SDNC_TYPE SDN controller to OSM"
42 osm sdnc-create
--name sdnc
--user "$SDNC_USER" --password "$SDNC_PASSWORD" --url "$SDNC_URL" --type "$SDNC_TYPE"
45 # TO-DO: add port-mapping file to VIM
46 # osm vim-update "$VIM_TARGET" --sdn_controller sdnc --sdn_port_mapping port-mapping-etsi-vim.yaml
49 # Add K8s cluster to OSM
50 if [ -n "$K8S_CREDENTIALS" ] && [ -n "$VIM_TARGET" ] && [ -n "$K8S_IMAGE_NAME" ]; then
51 echo "Adding K8s cluster to OSM"
52 osm k8scluster-add
--creds $K8S_CREDENTIALS --version v1
--vim $VIM_TARGET \
53 --k8s-nets "{'net1': '$VIM_MGMT_NET'}" $K8S_IMAGE_NAME --description "Robot cluster"
55 osm k8scluster-show
$K8S_IMAGE_NAME