cloudfoundry/cloud_controller_ng

View on GitHub
docs/v3/source/includes/api_resources/_service_plans.erb

Summary

Maintainability
Test Coverage
<% content_for :single_service_plan do %>
{
  "guid": "bf7eb420-11e5-11ea-b7db-4b5d5e7976a9",
  "name": "my_big_service_plan",
  "description": "Big",
  "visibility_type": "public",
  "available": true,
  "free": false,
  "costs": [
    {
      "currency": "USD",
      "amount": 199.99,
      "unit": "Monthly"
    }
  ],
  "created_at": "2019-11-28T13:44:02Z",
  "updated_at": "2019-11-28T13:44:02Z",
  "maintenance_info": {
    "version": "1.0.0+dev4",
    "description": "Database version 7.8.0"
  },
  "broker_catalog": {
    "id": "db730a8c-11e5-11ea-838a-0f4fff3b1cfb",
    "metadata": {
      "custom-key": "custom-information"
    },
    "maximum_polling_duration": null,
    "features": {
      "plan_updateable": true,
      "bindable": true
    }
  },
  "schemas": {
    "service_instance": {
      "create": {
        "parameters": {
          "$schema": "http://json-schema.org/draft-04/schema#",
          "type": "object",
          "properties": {
            "billing-account": {
              "description": "Billing account number used to charge use of shared fake server.",
              "type": "string"
            }
          }
        }
      },
      "update": {
        "parameters": {}
      }
    },
    "service_binding": {
      "create": {
        "parameters": {}
      }
    }
  },
  "relationships": {
    "service_offering": {
      "data": {
        "guid": "13c60e38-11e7-11ea-9106-33ee3c5bd4d7"
      }
    }
  },
  "metadata": {
    "labels": {},
    "annotations": {}
  },
  "links": {
    "self": {
      "href": "https://api.example.org/v3/service_plans/bf7eb420-11e5-11ea-b7db-4b5d5e7976a9"
    },
    "service_offering": {
      "href": "https://api.example.org/v3/service_offerings/13c60e38-11e7-11ea-9106-33ee3c5bd4d7"
    },
    "visibility": {
      "href": "https://api.example.org/v3/service_plans/bf7eb420-11e5-11ea-b7db-4b5d5e7976a9/visibility"
    }
  }
}

<% end %>

<%- content_for :paginated_list_of_service_plans do |base_url| -%>
{
  "pagination": {
    "total_results": 3,
    "total_pages": 2,
    "first": {
      "href": "https://api.example.org<%= base_url %>?page=1&per_page=2"
    },
    "last": {
      "href": "https://api.example.org<%= base_url %>?page=2&per_page=2"
    },
    "next": {
      "href": "https://api.example.org<%= base_url %>?page=2&per_page=2"
    },
    "previous": null
  },
  "resources": [
    {
      "guid": "bf7eb420-11e5-11ea-b7db-4b5d5e7976a9",
      "name": "my_big_service_plan",
      "description": "Big plan",
      "visibility_type": "organization",
      "available": true,
      "free": false,
      "costs": [
        {
          "currency": "USD",
          "amount": 199.99,
          "unit": "Monthly"
        }
      ],
      "created_at": "2019-11-28T13:44:02Z",
      "updated_at": "2019-11-28T13:44:02Z",
      "maintenance_info": {
        "version": "1.0.0+dev4",
        "description": "Database version 7.8.0"
      },
      "broker_catalog": {
        "id": "db730a8c-11e5-11ea-838a-0f4fff3b1cfb",
        "metadata": {
          "custom-key": "custom-value"
        },
        "maximum_polling_duration": null,
        "features": {
          "plan_updateable": true,
          "bindable": true
        }
      },
      "schemas": {
        "service_instance": {
          "create": {
            "parameters": {
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "object",
              "properties": {
                "billing-account": {
                  "description": "Billing account number used to charge use of shared fake server.",
                  "type": "string"
                }
              }
            }
          },
          "update": {
            "parameters": {}
          }
        },
        "service_binding": {
          "create": {
            "parameters": {}
          }
        }
      },
      "relationships": {
        "service_offering": {
          "data": {
            "guid": "13c60e38-11e7-11ea-9106-33ee3c5bd4d7"
          }
        }
      },
      "metadata": {
        "labels": {},
        "annotations": {}
      },
      "links": {
        "self": {
          "href": "https://api.example.org/v3/service_plans/bf7eb420-11e5-11ea-b7db-4b5d5e7976a9"
        },
        "service_offering": {
          "href": "https://api.example.org/v3/service_offerings/13c60e38-11e7-11ea-9106-33ee3c5bd4d7"
        },
        "visibility": {
          "href": "https://api.example.org/v3/service_plans/bf7eb420-11e5-11ea-b7db-4b5d5e7976a9/visibility"
        }
      }
    },
    {
      "guid": "20e6cd62-12bb-11ea-90d1-7bfec2c75bcd",
      "name": "other_service_plan",
      "description": "Provides another service plan",
      "visibility_type": "admin",
      "available": true,
      "free": true,
      "created_at": "2019-11-29T16:44:02Z",
      "updated_at": "2019-11-29T16:44:02Z",
      "maintenance_info": {},
      "broker_catalog": {
        "id": "3cb11822-12bb-11ea-beb1-a350dc7453b9",
        "metadata": {
          "other-data": true
        },
        "maximum_polling_duration": null,
        "features": {
          "plan_updateable": true,
          "bindable": true
        }
      },
      "schemas": {
        "service_instance": {
          "create": {
            "parameters": {}
          },
          "update": {
            "parameters": {}
          }
        },
        "service_binding": {
          "create": {
            "parameters": {}
          }
        }
      },
      "relationships": {
        "service_offering": {
          "data": {
            "guid": "13c60e38-11e7-11ea-9106-33ee3c5bd4d7"
          }
        }
      },
      "metadata": {
        "labels": {},
        "annotations": {}
      },
      "links": {
        "self": {
          "href": "https://api.example.org/v3/service_plans/20e6cd62-12bb-11ea-90d1-7bfec2c75bcd"
        },
        "service_offering": {
          "href": "https://api.example.org/v3/service_offerings/13c60e38-11e7-11ea-9106-33ee3c5bd4d7"
        },
        "visibility": {
          "href": "https://api.example.org/v3/service_plans/20e6cd62-12bb-11ea-90d1-7bfec2c75bcd/visibility"
        }
      }
    }
  ]
}
<%- end -%>