PredixDev / predix-rest-client

Other
7 stars 16 forks source link

view javadoc  

view github pages

Predix Rest Client

Welcome to Predix Rest Client, a Microcomponent Utility.

The predix-rest-client project provides standard GET, PUT, POST, DELETE with helpers to manage Predix OAuth Security in the cloud. See the property files and IOauthRestConfig.java which allow a microservice to connect to Predix UAA (User Authentication and Authorization) servers in the cloud. All the reference app microservices use this utility to make Rest calls in the cloud.

  1. Most of the time, you will make a dependency to predix-rest-client by adding this to your pom.xml

    <dependency>
        <groupId>com.ge.predix.solsvc</groupId>
        <artifactId>predix-rest-client</artifactId>
        <version>${predix-rest-client.version}</version>
    </dependency>
  2. If you started with a Predix Microservice Template you will have a property in config/application.properties which spins up certain beans marked with the Local Profile. Otherwise, add this property to your project.

    spring.profiles.active=local
  3. You also will want to check that Autowiring of these package is occurring by adding this file to your spring context

    "classpath:META-INF/spring/predix-rest-client-scan-context.xml" 
    
    which contains
    <context:component-scan
            base-package="
        com.ge.predix.solsvc.restclient.config
        com.ge.predix.solsvc.restclient.impl
        " />
    
  4. Or to view the source code you can download the project

    $ git clone https://github.com/PredixDev/predix-rest-client.git  
    
    $ cd predix-rest-client
    
    $ mvn clean package  
    
    note: mvn clean install may run integration tests against services you may not have set up yet

Dependencies

Required - latest unless specified Note
Java 8
Git
Maven https://artifactory.predix.io/artifactory/PREDIX-EXT
CloudFoundry ClI 6.12.2 https://github.com/cloudfoundry/cli/tree/v6.12.2#downloads. There is bug on this page, so you have to manually get the URL and the add "&version=6.12.2". For example for Windows32 it would look like this...https://cli.run.pivotal.io/stable?release=windows32&source=github&version=6.12.2

Analytics