def create(self, client=None):
        """API call:  create the metric via a PUT request

        See:
        https://cloud.google.com/logging/docs/api/ref_v2beta1/rest/v2beta1/projects.metrics/create

        :type client: :class:`gcloud.logging.client.Client` or ``NoneType``
        :param client: the client to use.  If not passed, falls back to the
                       ``client`` stored on the current metric.
        """
        client = self._require_client(client)
        target = '/projects/%s/metrics' % (self.project,)
        data = {
            'name': self.name,
            'filter': self.filter_,
        }
        if self.description:
            data['description'] = self.description
        client.connection.api_request(method='POST', path=target, data=data)
dataset/ETHPy150Open GoogleCloudPlatform/gcloud-python/gcloud/logging/metric.py/Metric.create/original