• Retrieve all snapshots for any impacted deployables.

    When config files are uploaded to an application data model, the system will create snapshots for any deployables determined to be impacted by the upload. Following along the CI flow, assuming the last Upload call had validation enabled, the next step would be to iterate through the list of snapshots and ensure they all passed validation.

  • Retrieve a specific snapshot.

    Following the CD flow, a specific snapshot is retrieved so it can be published and then exported to be consumed downstream (for example, to provision out infrastructure or application).

  • Show policy validation results in a pipeline execution.

    View policy validation results as test results on the Jenkins build tests results page, including compliant with exception, when getting a snapshot.

  • Example:
    • Specific snapshot (specified):
      $snapshots = snDevOpsConfigGetSnapshots(
      applicationName: 'PaymentDemo',
      deployableName: 'Production',
      changesetNumber: 'Chset-16'
      )
    • Latest validated snapshot (returns the latest snapshot for application and deployable combination):
      $snapshots = snDevOpsConfigGetSnapshots(
      applicationName: 'PaymentDemo',
      deployableName: 'Production',
      isValidated: 'true'
      )
    • All changeset snapshots (returns all snapshots for application and deployable combination):
      $snapshots = snDevOpsConfigGetSnapshots(
      applicationName: 'PaymentDemo',
      changesetNumber: 'Chset-16',
      )
    • Show policy validation results in a pipeline execution.
      1. Assign a variable to the path of the file that contains the snapshot validation results generated during the snDevOpsConfigGetSnapshots action.
      2. Call the JUnit action to load the snapshot validation results into the pipeline execution test section.
      stage('Validate') {
      steps {
      script {
      changeSetResults = snDevOpsConfigGetSnapshots( … )
      if (!changeSetResults) {
       echo "No snapshots were created"
      } else {
      def changeSetResultsObject = readJSON text: changeSetResults
      
      changeSetResultsObject.each {
           snapshotName = it.name
           snapshotObject = it
      }
      // STEP 1
      validationResultsPath = "${snapshotName}_${currentBuild.projectName}_${currentBuild.number}.xml"
      }
      }
      }
      }
      
      post {
      always {
      // STEP 2
      junit testResults: "${validationResultsPath}", skipPublishingChecks: true
      }
      }