Пример #1
0
    def apply(self):
        stub = ssl_cert_pb2_grpc.SqlBetaSslCertServiceStub(channel.Channel())
        request = ssl_cert_pb2.ApplySqlBetaSslCertRequest()
        if Primitive.to_proto(self.common_name):
            request.resource.common_name = Primitive.to_proto(self.common_name)

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

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

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

        request.service_account_file = self.service_account_file

        response = stub.ApplySqlBetaSslCert(request)
        self.cert_serial_number = Primitive.from_proto(
            response.cert_serial_number)
        self.cert = Primitive.from_proto(response.cert)
        self.create_time = Primitive.from_proto(response.create_time)
        self.common_name = Primitive.from_proto(response.common_name)
        self.expiration_time = Primitive.from_proto(response.expiration_time)
        self.name = Primitive.from_proto(response.name)
        self.instance = Primitive.from_proto(response.instance)
        self.project = Primitive.from_proto(response.project)
Пример #2
0
    def list(self, project, instance, service_account_file=""):
        stub = ssl_cert_pb2_grpc.SqlBetaSslCertServiceStub(channel.Channel())
        request = ssl_cert_pb2.ListSqlBetaSslCertRequest()
        request.service_account_file = service_account_file
        request.Project = project

        request.Instance = instance

        return stub.ListSqlBetaSslCert(request).items
Пример #3
0
    def delete(self, project, instance, name, service_account_file=""):
        stub = ssl_cert_pb2_grpc.SqlBetaSslCertServiceStub(channel.Channel())
        request = ssl_cert_pb2.DeleteSqlBetaSslCertRequest()
        request.service_account_file = service_account_file
        request.Project = project

        request.Instance = instance

        request.Name = name

        response = stub.DeleteSqlBetaSslCert(request)
Пример #4
0
    def delete(self):
        stub = ssl_cert_pb2_grpc.SqlBetaSslCertServiceStub(channel.Channel())
        request = ssl_cert_pb2.DeleteSqlBetaSslCertRequest()
        request.service_account_file = self.service_account_file
        if Primitive.to_proto(self.common_name):
            request.resource.common_name = Primitive.to_proto(self.common_name)

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

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

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

        response = stub.DeleteSqlBetaSslCert(request)