diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/resources/definition/YARN-Services-Examples.md b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/resources/definition/YARN-Services-Examples.md index 00b21dd..2fbc789 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/resources/definition/YARN-Services-Examples.md +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/resources/definition/YARN-Services-Examples.md @@ -15,7 +15,7 @@ ## Examples ### Create a simple single-component service with most attribute values as defaults -POST URL - http://localhost:9191/ws/v1/services +POST URL - http://localhost:8088/app/v1/services ##### POST Request JSON ```json @@ -41,7 +41,7 @@ POST URL - http://localhost:9191/ws/v1/services ``` ##### GET Response JSON -GET URL - http://localhost:9191/ws/v1/services/hello-world +GET URL - http://localhost:8088/app/v1/services/hello-world Note, lifetime value of -1 means unlimited lifetime. @@ -99,7 +99,7 @@ Note, lifetime value of -1 means unlimited lifetime. ``` ### Update to modify the lifetime of a service -PUT URL - http://localhost:9191/ws/v1/services/hello-world +PUT URL - http://localhost:8088/app/v1/services/hello-world ##### PUT Request JSON @@ -111,7 +111,7 @@ Note, irrespective of what the current lifetime value is, this update request wi } ``` ### Stop a service -PUT URL - http://localhost:9191/ws/v1/services/hello-world +PUT URL - http://localhost:8088/app/v1/services/hello-world ##### PUT Request JSON ```json @@ -121,7 +121,7 @@ PUT URL - http://localhost:9191/ws/v1/services/hello-world ``` ### Start a service -PUT URL - http://localhost:9191/ws/v1/services/hello-world +PUT URL - http://localhost:8088/app/v1/services/hello-world ##### PUT Request JSON ```json @@ -130,24 +130,36 @@ PUT URL - http://localhost:9191/ws/v1/services/hello-world } ``` -### Update to flex up/down the no of containers (instances) of a component of a service -PUT URL - http://localhost:9191/ws/v1/services/hello-world/components/hello +### Update to flex up/down the number of containers (instances) of a component of a service +PUT URL - http://localhost:8088/app/v1/services/hello-world/components/hello ##### PUT Request JSON ```json { - "name": "hello", "number_of_containers": 3 } ``` +Alternatively, you can specify the entire "components" section instead. + +PUT URL - http://localhost:8088/app/v1/services/hello-world +##### PUT Request JSON +```json +{ + "components" : [ { + "name" : "hello", + "number_of_containers" : 3 + } ] +} +``` + ### Destroy a service -DELETE URL - http://localhost:9191/ws/v1/services/hello-world +DELETE URL - http://localhost:8088/app/v1/services/hello-world *** ### Create a complicated service - HBase -POST URL - http://localhost:9191:/ws/v1/services/hbase-app-1 +POST URL - http://localhost:8088:/app/v1/services/hbase-app-1 ##### POST Request JSON diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/resources/definition/YARN-Simplified-V1-API-Layer-For-Services.yaml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/resources/definition/YARN-Simplified-V1-API-Layer-For-Services.yaml index 99767b3..efbfaa6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/resources/definition/YARN-Simplified-V1-API-Layer-For-Services.yaml +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services-api/src/main/resources/definition/YARN-Simplified-V1-API-Layer-For-Services.yaml @@ -36,8 +36,8 @@ info: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html # the domain of the service -host: host.mycompany.com -port: 9191(default) +host: localhost +port: 8088(default) # array of all schemes that your API supports schemes: - http diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/BaseResource.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/BaseResource.java index 7ac86d4..3d61fb7 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/BaseResource.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/api/records/BaseResource.java @@ -30,7 +30,7 @@ /** * Resource location for a service, e.g. - * /ws/v1/services/helloworld + * /app/v1/services/helloworld * **/ public String getUri() {