def extract_fields(self, metric):
m = {}<EOL>if '<STR_LIT:name>' in metric:<EOL><INDENT>m['<STR_LIT:name>'] = metric['<STR_LIT:name>']<EOL><DEDENT>if '<STR_LIT:description>' in metric:<EOL><INDENT>m['<STR_LIT:description>'] = metric['<STR_LIT:description>']<EOL><DEDENT>if '<STR_LIT>' in metric:<EOL><INDENT>m['<STR_LIT>'] = metric['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in metric:<EOL><INDENT>m['<STR_LIT>'] = metric['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in metric:<EOL><INDENT>m['<STR_LIT>'] = metric['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in metric:<EOL><INDENT>m['<STR_LIT>'] = metric['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in metric:<EOL><INDENT>m['<STR_LIT>'] = metric['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in metric:<EOL><INDENT>m['<STR_LIT>'] = metric['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in metric:<EOL><INDENT>m['<STR_LIT>'] = metric['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT:type>' in metric:<EOL><INDENT>m['<STR_LIT:type>'] = metric['<STR_LIT:type>']<EOL><DEDENT>return m<EOL>
Extract only the required fields for the create/update API call