This repository has been archived by the owner on Nov 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing issues related to create, update and read (#98)
* Fixing issues related to create, update and read 1. When reconfigure machine action is not enabled in the entitlement, do not allow update 2. In read resource, do not populate reconfigure template, just show whatever the provisioned request resource returns 3. Check the validity of config file in both create and update resource 4. Call appropriate vRA APIs to get the allowed actions on a provisioned resource 5. Return the failure message from the API when a request fails. 6. Code clean up: Handle error scenarios, add string constants, separate schema in a different file Signed-off-by: Prativa Bawri <[email protected]> Signed-off-by: Prativa Bawri <[email protected]>
- Loading branch information
Showing
7 changed files
with
662 additions
and
477 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,54 @@ | ||
package utils | ||
|
||
const ( | ||
REQUEST_STATUS = "request_status" | ||
//utility constants | ||
CATALOG_NAME = "catalog_name" | ||
CATALOG_ID = "catalog_id" | ||
BUSINESS_GROUP_ID = "businessgroup_id" | ||
BUSINESS_GROUP_NAME = "businessgroup_name" | ||
WAIT_TIME_OUT = "wait_timeout" | ||
FAILED_MESSAGE = "failed_message" | ||
DEPLOYMENT_CONFIGURATION = "deployment_configuration" | ||
RESOURCE_CONFIGURATION = "resource_configuration" | ||
CATALOG_CONFIGURATION = "catalog_configuration" | ||
REQUEST_STATUS = "request_status" | ||
INFRASTRUCTURE_VIRTUAL = "Infrastructure.Virtual" | ||
COMPONENT = "Component" | ||
RECONFIGURE = "Reconfigure" | ||
|
||
// read resource machine constants | ||
MACHINE_CPU = "cpu" | ||
MACHINE_STORAGE = "storage" | ||
MACHINE_MEMORY = "memory" | ||
IP_ADDRESS = "ip_address" | ||
MACHINE_NAME = "name" | ||
MACHINE_GUEST_OS = "guest_operating_system" | ||
MACHINE_BP_NAME = "blueprint_name" | ||
MACHINE_TYPE = "type" | ||
MACHINE_RESERVATION_NAME = "reservation_name" | ||
MACHINE_INTERFACE_TYPE = "interface_type" | ||
MACHINE_ID = "id" | ||
MACHINE_GROUP_NAME = "group_name" | ||
MACHINE_DESTRUCTION_DATE = "destruction_date" | ||
MACHINE_RECONFIGURE = "reconfigure" | ||
MACHINE_POWER_OFF = "power_off" | ||
|
||
// utility constants | ||
LOGGER_ID = "terraform-provider-vra7" | ||
WINDOWS_PATH_SEPARATOR = "\\" | ||
UNIX_PATH_SEPARATOR = "/" | ||
WINDOWS_OS = "windows" | ||
|
||
//error constants | ||
CONFIG_INVALID_ERROR = "The resource_configuration in the config file has invalid component name(s): %v " | ||
|
||
// api constants | ||
CATALOG_SERVICE = "/catalog-service" | ||
CATALOG_SERVICE_API = CATALOG_SERVICE + "/api" | ||
CONSUMER = CATALOG_SERVICE_API + "/consumer" | ||
CONSUMER_REQUESTS = CONSUMER + "/requests" | ||
CONSUMER_RESOURCES = CONSUMER + "/resources" | ||
GET_RESOURCE_API = CONSUMER_REQUESTS + "/" + "%s" + "/resources" | ||
POST_ACTION_TEMPLATE_API = CONSUMER_RESOURCES + "/" + "%s" + "/actions/" + "%s" + "/requests" | ||
GET_ACTION_TEMPLATE_API = POST_ACTION_TEMPLATE_API + "/template" | ||
GET_REQUEST_RESOURCE_VIEW_API = CONSUMER_REQUESTS + "/" + "%s" + "/resourceViews" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.