def delete(self):
        stub = managed_ssl_certificate_pb2_grpc.ComputeManagedSslCertificateServiceStub(
            channel.Channel())
        request = (managed_ssl_certificate_pb2.
                   DeleteComputeManagedSslCertificateRequest())
        request.service_account_file = self.service_account_file
        if Primitive.to_proto(self.name):
            request.resource.name = Primitive.to_proto(self.name)

        if Primitive.to_proto(self.description):
            request.resource.description = Primitive.to_proto(self.description)

        if ManagedSslCertificateManaged.to_proto(self.managed):
            request.resource.managed.CopyFrom(
                ManagedSslCertificateManaged.to_proto(self.managed))
        else:
            request.resource.ClearField("managed")
        if ManagedSslCertificateTypeEnum.to_proto(self.type):
            request.resource.type = ManagedSslCertificateTypeEnum.to_proto(
                self.type)

        if Primitive.to_proto(self.project):
            request.resource.project = Primitive.to_proto(self.project)

        response = stub.DeleteComputeManagedSslCertificate(request)
示例#2
0
    def list(self, project, service_account_file=""):
        stub = managed_ssl_certificate_pb2_grpc.ComputeManagedSslCertificateServiceStub(
            channel.Channel())
        request = managed_ssl_certificate_pb2.ListComputeManagedSslCertificateRequest(
        )
        request.service_account_file = service_account_file
        request.Project = project

        return stub.ListComputeManagedSslCertificate(request).items
示例#3
0
    def delete(self, project, name, service_account_file=""):
        stub = managed_ssl_certificate_pb2_grpc.ComputeManagedSslCertificateServiceStub(
            channel.Channel())
        request = (managed_ssl_certificate_pb2.
                   DeleteComputeManagedSslCertificateRequest())
        request.service_account_file = service_account_file
        request.Project = project

        request.Name = name

        response = stub.DeleteComputeManagedSslCertificate(request)
    def apply(self):
        stub = managed_ssl_certificate_pb2_grpc.ComputeManagedSslCertificateServiceStub(
            channel.Channel())
        request = managed_ssl_certificate_pb2.ApplyComputeManagedSslCertificateRequest(
        )
        if Primitive.to_proto(self.name):
            request.resource.name = Primitive.to_proto(self.name)

        if Primitive.to_proto(self.description):
            request.resource.description = Primitive.to_proto(self.description)

        if ManagedSslCertificateManaged.to_proto(self.managed):
            request.resource.managed.CopyFrom(
                ManagedSslCertificateManaged.to_proto(self.managed))
        else:
            request.resource.ClearField("managed")
        if ManagedSslCertificateTypeEnum.to_proto(self.type):
            request.resource.type = ManagedSslCertificateTypeEnum.to_proto(
                self.type)

        if Primitive.to_proto(self.project):
            request.resource.project = Primitive.to_proto(self.project)

        request.service_account_file = self.service_account_file

        response = stub.ApplyComputeManagedSslCertificate(request)
        self.name = Primitive.from_proto(response.name)
        self.id = Primitive.from_proto(response.id)
        self.creation_timestamp = Primitive.from_proto(
            response.creation_timestamp)
        self.description = Primitive.from_proto(response.description)
        self.self_link = Primitive.from_proto(response.self_link)
        self.managed = ManagedSslCertificateManaged.from_proto(
            response.managed)
        self.type = ManagedSslCertificateTypeEnum.from_proto(response.type)
        self.subject_alternative_names = Primitive.from_proto(
            response.subject_alternative_names)
        self.expire_time = Primitive.from_proto(response.expire_time)
        self.project = Primitive.from_proto(response.project)