Softlayer python客户端升级

时间:2017-08-24 02:42:22

标签: python ibm-cloud-infrastructure

我们正在使用softlayer-python-4.1.1,当我们调用self.ordering_manager.get_package_by_key(package_keyname)时,我们将得到异常“('OrderingManager'对象没有属性'get_package_by_key')”。这是因为我们使用的是我们客户的日期版本吗?新的客户端版本是否与我们现有的代码向后兼容?

1 个答案:

答案 0 :(得分:0)

错误是因为您使用的版本4.1.1没有该方法,它有方法:

    def get_package_id_by_type(self, package_type):
        """Return the package ID of a Product Package with a given type.

   def get_package_by_type(self, package_type, mask=None):
        """Get a single package of a given type.

  def get_packages_of_type(self, package_types, mask=None):
        """Get packages that match a certain type.

因此,如果您想使用方法get_package_by_key,则需要升级客户端。