Closed mattbarrio closed 7 years ago
OTC Api reference contains the API call that otc client uses in chapter 4.3: GET /v1/{tenant_id}/subnets https://docs.otc.t-systems.com/en-us/vpc_dld/index.html I'm checking openstack client for it's call details.
openstack client uses another api version. curl -g -i -X GET https://vpc.eu-de.otctest.t-systems.com/v2.0/subnets
There were problems with the otc delete-subnet command, that has been fixed in pull request https://github.com/OpenTelekomCloud/python-otcclient/pull/50
Please note that VPC is mandatory parameter of the delete.
Is there additional issues or that was it?
Fixed with f57118cb61f63a7f1969c11ad28dc096573eba61.
ISSUE When creating/describing a subnet the id that is returned is the network_id and not the id of the actual subnet.
STEPS TO REPRODUCE
root# otc ecs create-subnet --subnet-name ${ENV_NAME}-01 --cidr ${SUBNET_1_CIDR_BLOCK} --gateway-ip ${SUBNET_1_GATEWAY_IP} --primary-dns ${PRIMARY_DNS} --secondary-dns ${SECONDARY_DNS} --availability-zone eu-de-01 --vpc-name ${ENV_NAME}-vpc
>{"subnet":{"id":"4907224f-c12c-45bd-9f9a-18c99ec20a26","name":"ol-staging-01","cidr":"192.168.1.0/24","status":"UNKNOWN","vpc_id":"2c24c98d-7970-4506-b627-812c13ae8521","gateway_ip":"192.168.1.1","dhcp_enable":true,"primary_dns":"100.125.4.25","secondary_dns":"8.8.8.8","availability_zone":"eu-de-01"}}
root# otc ecs describe-subnets
>| status | name | availability_zone | primary_dns | gateway_ip | vpc_id | cidr | id | ACTIVE | ol-staging-01 | eu-de-01 | 100.125.4.25 | 192.168.1.1 | 2c24c98d-7970-4506-b627-812c13ae8521 | 192.168.1.0/24 | 4907224f-c12c-45bd-9f9a-18c99ec20a26 |
root# openstack subnet list
>| ID | Name | Network | Subnet | | 2e580847-e14e-4f8b-bdfd-e1fde65dda97 | ol-staging-01 | 4907224f-c12c-45bd-9f9a-18c99ec20a26 | 192.168.1.0/24 |
When sending delete to the endpoint with the network id this fails, 1) because there is a port attached to the subnet (seems to be the gateway_ip?) 2) because there is no subnet with the id of network id.
Anywork around with the native openstack client or thoughts about fixes on the otc client? I tried to delete the port via openstack cli but ended with error because of the device-owner=network:dhcp and didn't want to orphan any objects by removing that.