组织

更新
Cover image for: 组织

组织资源有助于将与API客户端相关的所有其他API资源链接在一起(此处客户端是API客户,而不是API客户端实现)。

必须先配置组织,然后才能使用其API密钥对API执行数据检索操作。如果没有至少一个有效的存储配置,API将不知道如何发布结果。

组织会跟踪一组基本权限。这些描述了允许组织内的哪些操作密钥针对API执行。

属性

名称类型描述
id 组织ID 资源标识符。
resource 字符串,总是organisation 资源类型说明符。
type 超级,字符串其中之一: standardsuper
name 为组织选择的名称。
slug name的slugified版本。
api_version API版本组织配置为使用的API版本。
config嵌套对象组织范围的配置设置。
permissions 权限资源嵌套权限资源。
storage_configs 列出包含存储配置资源的对象与组织关联的存储配置对象的嵌套列表。
storage_config_default 可选的存储配置ID 组织的默认存储配置的ID。
webhook_configs 列出包含webhook配置资源的对象与组织关联的Webhook配置对象的嵌套列表。
webhook_config_default 可选的webhook配置ID 组织的默认webhook配置的ID。
state 其中之一: unconfiguredactivedeactivated ,已blocked
date_created 约会时间资源创建时。

种类

standard
对于API的客户。
super
适用于API的内部经理。

配置

可以在组织的config属性上设置组织级别的配置。目前只接受publish_source_files ,与源文件发布机制相关。

权限

permissions值指定组织的基本权限集。这些是对该组织的任何子资源提供的最不严格的权限,即密钥或用户无法访问比其所属组织更多的数据。

状态

unconfigured
每个组织都是在这种状态下创建的。处于此状态会阻止对大多数数据检索功能的访问。
active
组织已配置并可以使用API的所有部分。
deactivated
该组织已根据业主的要求关闭。
blocked
该组织已被API管理员关闭。

变更日志

2020-02-20

  • 重大现在,组织对象的storage_configswebhook_configs属性是嵌套列表对象,而不是简单的列表属性。

检索GET /organisation

使用cURL

curl https://ricloud-api.reincubate.com/organisation \
  -H 'Authorization: Token <your key_token>'

使用ricloud-py

import ricloud

ricloud.Organisation.retrieve()

样品回复

{
  "id": 1,
  "resource": "organisation",
  "name": "My org",
  "slug": "my-org",
  "api_version": "2020-02-20",
  "permissions": {
    "id": 1,
    "resource": "organisation_permissions",
    "identifier": "default",
    "scopes": {
      "source_type:icloud.*": [],
      "task_type:*": [],
      "data_type:icloud.account.info": [],
    },
    "date_created": "2018-11-08T13:05:29.954188Z"
  },
  "storage_configs": {
    "data": [
      {
        "id": 1,
        "resource": "storage_config",
        "type": "gs",
        "url": "gs://my-storage-bucket",
        "credentials": {},
        "state": "valid",
        "date_created": "2018-11-08T16:47:56.849618Z"
      }
    ],
    "has_more": false,
    "total_count": 1,
    "url": "/configs/storage"
  },
  "storage_config_default": 1,
  "webhook_configs": {
    "data": [
      {
        "id": 1,
        "resource": "webhook_config",
        "url": "https://www.mywebhookendpoint.com/webhooks",
        "secret": "Wg69dQaffJuXckXsdoHuPYkf3VSWEGMa",
        "state": "valid",
        "date_created": "2018-11-08T13:07:59.563975Z"
      }
    ],
    "has_more": false,
    "total_count": 1,
    "url": "/configs/webhook"
  },
  "webhook_config_default": 1,
  "state": "active",
  "date_created": "2018-11-08T13:05:29.784270Z"
}

更新POST /organisation

参数

名称类型描述
name 更改组织的显示名称。
storage_config_default 存储配置ID 更改组织使用的默认存储配置。
webhook_config_default webhook配置ID 更改组织使用的默认webhook配置。

使用cURL

curl 'https://ricloud-api.reincubate.com/organisation' \
  -X POST \
  -H 'Authorization: Token <your key_token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "My new organisation name"
}'

使用ricloud-py

import ricloud

ricloud.Organisation.update(name='My new org')

样品回复。请注意, slug属性不会更改,因为它仅在初始组织创建时生成。

{
  "id": 1,
  "resource": "organisation",
  "name": "My new org",
  "slug": "my-org",
  "permissions": {},
  "storage_configs": {
    "data": [
      {
        "id": 1,
        "resource": "storage_config",
        "type": "gs",
        "url": "gs://my-storage-bucket",
        "credentials": {},
        "state": "valid",
        "date_created": "2018-11-08T16:47:56.849618Z"
      }
    ],
    "has_more": false,
    "total_count": 1,
    "url": "/configs/storage"
  },
  "storage_config_default": 1,
  "webhook_configs": {
    "data": [
      {
        "id": 1,
        "resource": "webhook_config",
        "url": "https://www.mywebhookendpoint.com/webhooks",
        "secret": "Wg69dQaffJuXckXsdoHuPYkf3VSWEGMa",
        "state": "valid",
        "date_created": "2018-11-08T13:07:59.563975Z"
      }
    ],
    "has_more": false,
    "total_count": 1,
    "url": "/configs/webhook"
  },
  "webhook_config_default": 1,
  "state": "active",
  "date_created": "2018-11-08T13:05:29.784270Z"
}

我们能帮你什么吗?

我们的支持团队在这里提供帮助!

我们的办公时间是格林威治标准时间周一至周五上午9点至下午5点。 时间目前是 8:42 AM的 GMT。

我们力争在一个工作日内答复所有垂询。

我们的支持团队非常棒

我们可以改进这篇文章吗?

我们喜欢听取用户的意见:为什么不给我们发电子邮件,发表评论或发推文 @reincubate?

© 2008 - 2024 Reincubate Ltd. 保留所有权利。 在英格兰和威尔士注册 #5189175, VAT GB151788978. Reincubate®和Camo®是注册商标。 隐私政策 & 条款.