Class GoogleCloudPlatform

    • Constructor Detail

      • GoogleCloudPlatform

        public GoogleCloudPlatform()
    • Method Detail

      • getInstanceTypeMetadataEndpoint

        public String getInstanceTypeMetadataEndpoint()
        Specified by:
        getInstanceTypeMetadataEndpoint in interface CloudPlatform
        Returns:
        url string for fetching the platform instance type via the platform metadata service
      • getMetadataHeaders

        public Map<String,​String> getMetadataHeaders()
        Specified by:
        getMetadataHeaders in interface CloudPlatform
        Returns:
        any specific request headers required to reach the platform metadata service as a map of header-value entries
      • parseInstanceType

        public String parseInstanceType​(String responseBody)
        Expected responseBody format: projects/[NUMERIC_PROJECT_ID]/machineTypes/[MACHINE_TYPE] See https://cloud.google.com/compute/docs/storing-retrieving-metadata for more details
        Specified by:
        parseInstanceType in interface CloudPlatform
        Parameters:
        responseBody - the response body returned by the instance type metadata endpoint
        Returns:
        the Google Cloud Platform instance type parsed from the response body string