ConfigurationManager

extension ConfigurationManager

Copyright IBM Corporation 2016,2017

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

  • Undocumented

    Declaration

    Swift

    public var isLocal: Bool { get }
  • app

    Undocumented

    Declaration

    Swift

    public var app: [String : Any] { get }
  • Undocumented

    Declaration

    Swift

    public var port: Int { get }
  • Undocumented

    Declaration

    Swift

    public var name: String? { get }
  • Undocumented

    Declaration

    Swift

    public var bind: String { get }
  • Undocumented

    Declaration

    Swift

    public var urls: [String] { get }
  • url

    Undocumented

    Declaration

    Swift

    public var url: String { get }
  • Undocumented

    Declaration

    Swift

    public var services: [String : Any] { get }
  • Returns an App object.

    Declaration

    Swift

    public func getApp() -> App?
  • Returns all services bound to the application in a dictionary. The key in the dictionary is the name of the service, while the value is a Service object that contains all the properties for the service.

    Declaration

    Swift

    public func getServices() -> [String : Service]
  • Returns an array of Service objects that match the specified type. If there are no services that match the type parameter, this method returns an empty array.

    Declaration

    Swift

    public func getServices(type: String) -> [Service]
  • Returns a Service object with the properties for the specified Cloud Foundry service. The spec parameter should be the name of the service or a regex to look up the service. If there is no service that matches the spec parameter, this method returns nil.

    Declaration

    Swift

    public func getService(spec: String) -> Service?
  • Returns a URL generated from VCAP_SERVICES for the specified service or nil if service is not found. The spec parameter should be the name of the service or a regex to look up the service.

    The replacements parameter is a JSON object with the properties found in Foundation’s URLComponents class.

    Declaration

    Swift

    public func getServiceURL(spec: String, replacements: [String : Any]?) -> String?
  • Returns a JSON object that contains the credentials for the specified Cloud Foundry service. The spec parameter should be the name of the service or a regex to look up the service. If there is no service that matches the spec parameter, this method returns nil. In the case there is no credentials property for the specified service, an empty JSON is returned.

    Declaration

    Swift

    public func getServiceCreds(spec: String) -> [String : Any]?