跳转到主要内容

Juju操作员的序列化数据接口

项目描述

序列化数据接口库

https://pypi.ac.cn/project/serialized-data-interface/

这个库使用户能够创建序列化和验证的Juju操作员接口。

接口模式将通过YAML定义,例如

v1:
  provides:
    type: object
    properties:
      access-key:
        type: string
      namespace:
        type: ['string', 'null']
      port:
        type: number
      secret-key:
        type: string
      secure:
        type: boolean
      service:
        type: string
    required:
      - access-key
      - port
      - secret-key
      - secure
      - service

当我们的chars交换数据时,这个库将通过两端的模式验证数据。

用法

在我们的charm元数据中,我们会添加以下行来定义我们的模式和支持的版本

provides:
  oidc-client:
    interface: oidc-client
    schema: https://raw.githubusercontent.com/canonical/operator-schemas/oidc-schemas/oidc-client.yaml
    versions: [v1]

在这种情况下,SDI 将在部署期间从 GitHub 拉取模式。如果我们想在 GitHub 不可用的环境中部署我们的 charm,我们可以在构建过程中通过在 tox.ini 文件中添加一些类似以下的行来拉取模式

[testenv:build]
commands =
    charmcraft build
    python3 -m serialized_data_interface.local_sdi

真实世界示例

待办事项

  • 目前仅提供数据与应用程序之间的关系,还应支持单元关系。

项目详情


下载文件

下载您平台上的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源代码分发

serialized_data_interface-0.7.0.tar.gz (18.0 kB 查看哈希值)

上传时间

构建分发

serialized_data_interface-0.7.0-py3-none-any.whl (21.5 kB 查看哈希值)

上传时间 Python 3

由以下赞助商支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面