Skip to content

Updating sdk

Christina-Kang edited this page Apr 5, 2018 · 3 revisions

The Service Fabric CLI uses the underlying Azure Python SDK generated from Azure Service Fabric Open API (Swagger) specifications.

When making changes to the API specification, it is important to propagate all the changes from Swagger to the CLI. This way, customers who use the CLI stay current.

Follow these instructions to update the CLI when making changes to the API specifications.

Required files

Specifications are written using the Open API standard with Swagger. There is generally one servicefabric.json file or servicefabric.yml file that contains the entire specification. In addition, there may be some examples in relative paths. Therefore you will need:

  • servicefabric.json, a single file with the full specification
  • examples/*, a directory with links to examples for the APIs

For MS (internal) contributors

For each new release of Service Fabric, these files can be found in a build of the SF-Swagger repository. The path has commonly been out\debug-AMD64\swagger-sfclient\<version>, where <version> is the latest version available.

Update Azure API specification

First, create a PR to update the Open API specification in the Azure repository.

The CLI uses the data plane specification.

Follow the standard contribution guidelines to update all the files to their latest version. Update includes the examples and the main servicefabric.json specification.

Selecting a version

If there are minor updates that are fixes for an existing Service Fabric runtime version, update the files in place.

When the APIs are being updated for a major or minor release for a new Service Fabric runtime version, create a subdirectory in the folder with the major, minor, and build version number. If this release is a new release of Service Fabric 10.0, the folder name should be 10.0. If it is a new CU of an existing version, the folder name should be 10.0.1.

Dividing the API into different folders per version is intentional since multiple versions of Service Fabric are supported at any one time.

Update the Python SDK

After the Open API specification has been updated, a new Python SDK can be generated from the specification. Easiest way to request an update is to create a new issue in the python SDK repo.

Someone will pick up the request and publish a new package. This package is commonly called azure-servicefabric. Once the package has been published, it can be absorbed in the CLI.

Switch to latest package in CLI

After the package has been published, modify the following section in src\setup.py:

install_requires=[
    'azure-servicefabric==5.6.130',
],

The new version should replace the 5.6.130 string. After making this change, be sure to rerun the pip install -e .\src command as the new package will need to be installed.