dragon88112 2011-04-28 12:47
浏览 29
已采纳

PHP中是否有使用Rackspace Cloud API的开源程序? [关闭]

I want to use Rackspace API which is based on ReST.
I am able to get all the output using GET request (Using CURL in PHP).
Here is a piece of information I found which I could not understand:

Example 4.4. Server Create Request: 

JSON 
  {
  "server" : {
  "name" : "new-server-test",
  "imageId" : 1,
  "flavorId" : 1,
  "metadata" : {
    "My Server Name" : "Apache1"
  },
  "personality" : [
    {
      "path" : "/etc/banner.txt",
      "contents" :
      "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp
      dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k
      IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs
      c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g
      QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo
      ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv
      dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy
      c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6
      b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
      }
    ]
  }
 }

Now how do I make a Request In JSON format?
Is there any implementation of RackSpace Cloud Server API which I can see and understand?

Thanx

  • 写回答

1条回答 默认 最新

  • dongluanjie8678 2011-04-28 13:01
    关注

    Unfortunately I have never used it, but with a quick search on everyone's favourite search engine I found rackspace-cloud-api:

    The Rackspace Cloud API for PHP is intended to be a full API for all Rackspace Cloud services.

    The initial offering focuses on Cloud Servers.

    To use this API, you must place a copy of the Zend framework in your include_path.

    Looks like it is based on Zend Framework.

    Another github hosted project is Rackspace-Cloud-PHP-Library, which again I have not used. The maintainers homepage also has some detail: http://blog.pas.net.au/2009/08/rackspace-cloud-api-php-library/

    The Rackspace Cloud has released an API for their Cloud Servers which you can find here:

    http://www.rackspacecloud.com/cloud_hosting_products/servers/api The Cloud Server API is currently in beta, and does not have any libraries available to simplify making calls, so I have created this PHP one.

    This is strictly for PHP5 since PHP4 should be forgotten forever.

    The API has some poorly written documentation, but it is still useful. You can find it at this address:
    http://docs.rackspacecloud.com/servers/api/cs-devguide-latest.pdf

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画