Skip To Content
ArcGIS Developer
Dashboard

Create service

  • URL: https://<notebookserveradmin>/services/createService(POST only)
  • Required Capability:Administrator or Create and Edit ArcGIS Notebooks
  • Version Introduced:10.9.1

Description

ArcGIS Notebook Server supports publishing a geoprocessing service from a notebook. The createService operation creates a service when a JSON representation of the service is submitted to it.

To publish a service on Notebook Server, you must be an administrator or a user with Notebook and Publish Web Tools privileges. The notebook must belong to the user publishing the service.

A notebook-to-web tool relationship is created for maintaining the relation between the notebook and the associated web tool created for the service. This relationship ensures that ownership and sharing permissions are the same for both. When a notebook is deleted, the associated web tool is also deleted.

Request parameters

ParameterDetails
serviceProperties

The JSON representation of the service being created.

Example

{
  "description": "<Service Description>",
  "provider": "notebooks",
  "type": "GPServer",
  "jsonProperties": {
    "title": "<ServiceItemTitle>",
    "notebookId": "<notebookItemId>",
    "tasks": [
      {
        "type": "notebook",
        "name": "<taskName>"
      }
    ]
  }
}
f

The response format. The default response format is html.

Values: html | json | pjson

Example usage

https://notebookservermachine.domain.com/webadaptor/admin/services/createService  
serviceProperties = {
  "description": "This is a sample web tool description",
  "provider": "notebooks",
  "type": "GPServer",
  "jsonProperties": {
    "title": "WebToolItemTitle",
    "notebookId": "9fd15e228e7b4110a86c12a8245b24f2",
    "tasks": [
      {
        "type": "notebook",
        "name": "webtoolinputtest"
      }
    ]
  }
}

JSON Response syntax

{ 
  "itemId": "itemId number", 
  "status": "success" 
}

JSON Response example

The following is a sample response for the createService operation and includes the itemId of the web tool:

{ 
  "itemId": "5599ee6266414c3ba051fc6db9e7b993", 
  "status": "success" 
}

JSON Response example

The following error response is returned when an attempt is made to create a service with a notebook owned by another user:

{ 
  "error": { 
    "code": 500, 
    "message": "Unable to publish a web tool. To create a web tool from a notebook, the user must own the notebook item.", 
    "details": null 
  } 
}