3.7.5 Checking registration status of YAML files

Execute the API “gitops-logs” to confirm the status of YAML file registration operations for Ops I.

API authentication must be performed to execute API requests. For details, see “API reference overview > Prerequisite knowledge” in the “JP1 Cloud Service/Operations Integration API Reference”.

An example of API execution is shown below.

/api/v1/gitops-logs

# curl -XGET "Ops I URL/api/v1/gitops-logs" ¥
-H "X-OpsI-Token: Ops I token"

[How to read the operation log]

The success/failure of YAML file operations and the errors in the files that caused the failure (syntax/dependencies) can be checked in the “gitops-logs” API operation log.

Check the “result” in the operation log for the execution results of gitops-logs. The output results are as follows.

  • applied: Successful
  • recovered: Restored
  • failed: Failed

If the result is failed, registration of the YAML file has failed. If registration has failed, the following will be displayed in “detail”, and the location can be identified and the cause of the failure can be checked.

  • column: Column in which the error occurred
  • data: Line data in which the error occurred
  • line: Line in which the error occurred
  • message: Detailed error message

“Recovered” indicates the state in which a YAML file that failed due to an error in a dependency in a past commit has recovered its registration status as a result of the dependency error being resolved in a later commit. (Example of a dependency error being resolved: when a YAML file with a dependency is successfully registered or deleted, etc.)

NotesNotes

The following "failed" results may appear in the operation log, but this is not a problem.

kind: system
name: conf
result: failed
reason: format_error
detail.message: "Validator for kind 'system', apiVersion '1.0' does not exists"



[If there is no operation log]

If there is no operation log for the “gitops-logs” API YAML file, it is not recognized as a document by Ops I, even if it has been committed on GitLab, and it is not reflected in Ops I.
Possible causes are as follows.

  • The registered file was not a YAML file
  • YAML file management is disabled for the commit destination repository. (For information about YAML file management, see “Repository management”.)
  • The file extension or file name (manifest.yaml) are different

The status of YAML file registration operations can also be checked on the GitOps Log tab in the system application. For information on the GitOps Log tab, see “GitOps log tab” and “Checking registration status of YAML files (GUI)”.