title: What is the proper way to split a source into resource name/zone/project?
body: <p>I'm listing instances using the <a href="https://developers.google.com/docs/api/quickstart/python" rel="nofollow noreferrer">google cloud python library</a> method:
  <code>service.instances().list()</code></p>
  <p>This returns a dict of instances, for each instance it returns a list of disks, and for each disk the <code>source</code> of the disk is available in the following format:</p>
  <pre><code>https://www.googleapis.com/compute/v1/projects/&lt;project name&gt;/zones/&lt;zone&gt;/disks/&lt;disk name&gt;
  </code></pre>
  <p>There is no other &quot;name&quot; in the disks dict, so that is the closest thing I have to retrieve the disk name.</p>
  <p>After looking into other methods many of them return resources in a similar way.</p>
  <p>However, if I want to use any <code>google disk</code> methods from the library, it's expected that I supply the disk name, project and zone as separate arguments to the library's method.</p>
  <p>Is there a common method I can write to split the resource parameters?</p>
  <p>In this example this would be project name, zone and disk name, but other resources might have different resources.</p>
  <p>I could not find any method in the library that would do the split for me, so I guess it's expected that I write my own.</p>